IdentityFile

Struct IdentityFile 

Source
pub struct IdentityFile<C>
where C: Callbacks,
{ /* private fields */ }
Expand description

A list of identities that has been parsed from some input file.

Implementations§

Source§

impl IdentityFile<NoCallbacks>

Source

pub fn from_file(filename: String) -> Result<IdentityFile<NoCallbacks>, Error>

Parses one or more identities from a file containing valid UTF-8.

Source

pub fn from_buffer<R>(data: R) -> Result<IdentityFile<NoCallbacks>, Error>
where R: BufRead,

Parses one or more identities from a buffered input containing valid UTF-8.

Source

pub fn from_input_reader( reader: InputReader, ) -> Result<IdentityFile<NoCallbacks>, Error>

Parses one or more identities from an InputReader;

Source§

impl<C> IdentityFile<C>
where C: Callbacks,

Source

pub fn with_callbacks<D>(self, callbacks: D) -> IdentityFile<D>
where D: Callbacks,

Sets the provided callbacks on this identity file, so that if this is an encrypted identity, it can potentially be decrypted.

Source

pub fn write_recipients_file<W>( &self, output: W, ) -> Result<(), IdentityFileConvertError>
where W: Write,

Writes a recipients file containing the recipients corresponding to the identities in this file.

Returns an error if this file is empty, or if it contains plugin identities (which can only be converted by the plugin binary itself).

Source

pub fn to_recipients( &self, ) -> Result<Vec<Box<dyn Recipient + Send>>, EncryptError>

Returns recipients for the identities in this file.

Plugin identities will be merged into one Recipient per unique plugin.

Source

pub fn into_identities( self, ) -> Result<Vec<Box<dyn Identity + Sync + Send>>, DecryptError>

Returns the identities in this file.

Auto Trait Implementations§

§

impl<C> Freeze for IdentityFile<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for IdentityFile<C>
where C: RefUnwindSafe,

§

impl<C> Send for IdentityFile<C>

§

impl<C> Sync for IdentityFile<C>

§

impl<C> Unpin for IdentityFile<C>
where C: Unpin,

§

impl<C> UnwindSafe for IdentityFile<C>
where C: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V