pub struct AutocryptSetupMessageParser<'a> { /* private fields */ }
Expand description
A Parser for an AutocryptSetupMessage
.
Implementations§
source§impl<'a> AutocryptSetupMessageParser<'a>
impl<'a> AutocryptSetupMessageParser<'a>
sourcepub fn passcode_format(&self) -> Option<&str>
pub fn passcode_format(&self) -> Option<&str>
Returns the “Passcode-Format” header.
sourcepub fn passcode_begin(&self) -> Option<&str>
pub fn passcode_begin(&self) -> Option<&str>
Returns the “Passcode-Begin” header.
sourcepub fn decrypt(&mut self, passcode: &Password) -> Result<()>
pub fn decrypt(&mut self, passcode: &Password) -> Result<()>
Tries to decrypt the message.
On success, follow up with
AutocryptSetupMessageParser::parse()
to extract the
AutocryptSetupMessage
.
sourcepub fn parse(self) -> Result<AutocryptSetupMessage>
pub fn parse(self) -> Result<AutocryptSetupMessage>
Finishes parsing the AutocryptSetupMessage
.
Before calling this, you must decrypt the payload using
decrypt
.
If the payload has not been decrypted, returns
Error::InvalidOperation
.
If the payload is malformed, returns
Error::MalformedMessage
.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for AutocryptSetupMessageParser<'a>
impl<'a> Send for AutocryptSetupMessageParser<'a>
impl<'a> Sync for AutocryptSetupMessageParser<'a>
impl<'a> Unpin for AutocryptSetupMessageParser<'a>
impl<'a> !UnwindSafe for AutocryptSetupMessageParser<'a>
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
Mutably borrows from an owned value. Read more