#[non_exhaustive]pub enum DecryptError {
NoMatchingKey,
Other {
source: Error,
},
}Expand description
Errors that could occur during AEAD decryption.
The variants are load-bearing control flow between decryptor layers:
NoMatchingKey drives the refresh-and-retry loop
in RetryingDecryptor and candidate dispatch
in MultiKeyDecryptor — the cipher analogue
of VerifyError. Only its
Other source is the concrete Error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NoMatchingKey
No key matched the requested algorithm/kid criteria — decryption was not attempted.
Other
Other kinds of errors that could occur during decryption, including authentication failure.
Implementations§
Source§impl DecryptError
impl DecryptError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
If true, a failed decryption may succeed if retried.
Trait Implementations§
Source§impl Debug for DecryptError
impl Debug for DecryptError
Source§impl Display for DecryptError
impl Display for DecryptError
Source§impl Error for DecryptError
impl Error for DecryptError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl ErrorCompat for DecryptError
impl ErrorCompat for DecryptError
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
Error::source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for DecryptError
impl !UnwindSafe for DecryptError
impl Freeze for DecryptError
impl Send for DecryptError
impl Sync for DecryptError
impl Unpin for DecryptError
impl UnsafeUnpin for DecryptError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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