#[non_exhaustive]pub enum CipherError {
Authentication,
Malformed {
context: &'static str,
},
UnknownKeyId {
key_id: u8,
},
}Expand description
A failure raised by a PayloadCipher.
Like DurableError, a CipherError carries metadata only — never payload bytes, nonces, or
key material (INV-5) — so it is always safe to log. The enum is #[non_exhaustive]: a concrete
cipher may surface additional failure modes in future revisions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Authentication
The AEAD tag did not verify: the entry was forged, relocated, or replayed under a different
execution. Maps to DurableError::ReplayIntegrity.
Malformed
The stored blob is too short or otherwise structurally invalid before decryption.
UnknownKeyId
The blob’s leading key-id selects no key registered with the cipher (e.g. a stale key was removed before its rotation window closed).
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<CipherError> for DurableError
impl From<CipherError> for DurableError
Source§fn from(err: CipherError) -> Self
fn from(err: CipherError) -> Self
Lift a cipher failure into the crate-wide error, preserving fail-closed semantics.
An authentication failure is a replay-integrity violation; a structural or key-selection failure is a decode failure. Both fail closed — no plaintext is ever returned.
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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