#[non_exhaustive]pub enum CipherError {
KeyDecode(String),
KeyWrongLength(usize),
Encrypt(String),
CiphertextDecode(String),
CiphertextTruncated,
NonceSize,
Decrypt(String),
PlaintextUtf8(String),
}Expand description
Errors produced by TokenCipher.
Every variant is “unrecoverable for this session” from the consumer’s point of view — the correct response is to drop the cached auth context and force the user to re-auth. There is no retry that will turn a cipher failure into success.
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.
KeyDecode(String)
KeyWrongLength(usize)
Encrypt(String)
CiphertextDecode(String)
CiphertextTruncated
NonceSize
Decrypt(String)
PlaintextUtf8(String)
Trait Implementations§
Source§impl Debug for CipherError
impl Debug for CipherError
Source§impl Display for CipherError
impl Display for CipherError
Source§impl Error for CipherError
impl Error for CipherError
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for CipherError
impl RefUnwindSafe for CipherError
impl Send for CipherError
impl Sync for CipherError
impl Unpin for CipherError
impl UnsafeUnpin for CipherError
impl UnwindSafe for CipherError
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