pub struct IdentityFile<C: Callbacks> { /* private fields */ }Expand description
A list of identities that has been parsed from some input file.
Implementations§
Source§impl IdentityFile<NoCallbacks>
impl IdentityFile<NoCallbacks>
Sourcepub fn from_file(filename: String) -> Result<Self>
pub fn from_file(filename: String) -> Result<Self>
Parses one or more identities from a file containing valid UTF-8.
Sourcepub fn from_buffer<R: BufRead>(data: R) -> Result<Self>
pub fn from_buffer<R: BufRead>(data: R) -> Result<Self>
Parses one or more identities from a buffered input containing valid UTF-8.
Sourcepub fn from_input_reader(reader: InputReader) -> Result<Self>
Available on crate feature cli-common only.
pub fn from_input_reader(reader: InputReader) -> Result<Self>
cli-common only.Parses one or more identities from an InputReader;
Source§impl<C: Callbacks> IdentityFile<C>
impl<C: Callbacks> IdentityFile<C>
Sourcepub fn with_callbacks<D: Callbacks>(self, callbacks: D) -> IdentityFile<D>
pub fn with_callbacks<D: Callbacks>(self, callbacks: D) -> IdentityFile<D>
Sets the provided callbacks on this identity file, so that if this is an encrypted identity, it can potentially be decrypted.
Sourcepub fn write_recipients_file<W: Write>(
&self,
output: W,
) -> Result<(), IdentityFileConvertError>
pub fn write_recipients_file<W: Write>( &self, output: W, ) -> Result<(), IdentityFileConvertError>
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).
Sourcepub fn to_recipients(
&self,
) -> Result<Vec<Box<dyn Recipient + Send>>, EncryptError>
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.
Sourcepub fn into_identities(self) -> Result<Vec<Box<dyn Identity>>, DecryptError>
pub fn into_identities(self) -> Result<Vec<Box<dyn Identity>>, 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more