Enum dcaf::error::CoseCipherError
source · [−]#[non_exhaustive]
pub enum CoseCipherError<T> where
T: Display, {
HeaderAlreadySet {
existing_header_name: String,
},
VerificationFailure,
DecryptionFailure,
Other(T),
}
Expand description
Error type used when a CoseEncrypt0Cipher
,
CoseSign1Cipher
, or CoseMac0Cipher
.
fails to perform an operation.
T
is the type of the nested error represented by the Other
variant.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
HeaderAlreadySet
Fields
existing_header_name: String
The name of the header which has already been set.
A header which the cipher is supposed to set has already been set.
VerificationFailure
The given signature or MAC tag is either invalid or does not match the given data.
DecryptionFailure
The given ciphertext could not be decrypted.
Other(T)
A different error has occurred. Details are provided in the contained error.
Implementations
sourceimpl<T> CoseCipherError<T> where
T: Display,
impl<T> CoseCipherError<T> where
T: Display,
sourcepub fn existing_header_label(label: &Label) -> CoseCipherError<T>
pub fn existing_header_label(label: &Label) -> CoseCipherError<T>
Creates a new CoseCipherError
of type
HeaderAlreadySet
where the header
that was already set has the name of the given label
.
sourcepub fn existing_header<S>(name: S) -> CoseCipherError<T> where
S: Into<String>,
pub fn existing_header<S>(name: S) -> CoseCipherError<T> where
S: Into<String>,
Creates a new CoseCipherError
of type
HeaderAlreadySet
where the header
that was already set has the given name
.
sourcepub fn other_error(other: T) -> CoseCipherError<T>
pub fn other_error(other: T) -> CoseCipherError<T>
Creates a new CoseCipherError
of type
Other
(i.e., an error type that doesn’t fit any other
CoseCipherError
variant) containing the given nested error other
.
Trait Implementations
sourceimpl<T: Clone> Clone for CoseCipherError<T> where
T: Display,
impl<T: Clone> Clone for CoseCipherError<T> where
T: Display,
sourcefn clone(&self) -> CoseCipherError<T>
fn clone(&self) -> CoseCipherError<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: Debug> Debug for CoseCipherError<T> where
T: Display,
impl<T: Debug> Debug for CoseCipherError<T> where
T: Display,
sourceimpl<T> Display for CoseCipherError<T> where
T: Display,
impl<T> Display for CoseCipherError<T> where
T: Display,
sourceimpl<T> Error for CoseCipherError<T> where
T: Debug + Display,
impl<T> Error for CoseCipherError<T> where
T: Debug + Display,
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl<T: Hash> Hash for CoseCipherError<T> where
T: Display,
impl<T: Hash> Hash for CoseCipherError<T> where
T: Display,
sourceimpl<T: PartialEq> PartialEq<CoseCipherError<T>> for CoseCipherError<T> where
T: Display,
impl<T: PartialEq> PartialEq<CoseCipherError<T>> for CoseCipherError<T> where
T: Display,
sourcefn eq(&self, other: &CoseCipherError<T>) -> bool
fn eq(&self, other: &CoseCipherError<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CoseCipherError<T>) -> bool
fn ne(&self, other: &CoseCipherError<T>) -> bool
This method tests for !=
.
impl<T: Eq> Eq for CoseCipherError<T> where
T: Display,
impl<T> StructuralEq for CoseCipherError<T> where
T: Display,
impl<T> StructuralPartialEq for CoseCipherError<T> where
T: Display,
Auto Trait Implementations
impl<T> RefUnwindSafe for CoseCipherError<T> where
T: RefUnwindSafe,
impl<T> Send for CoseCipherError<T> where
T: Send,
impl<T> Sync for CoseCipherError<T> where
T: Sync,
impl<T> Unpin for CoseCipherError<T> where
T: Unpin,
impl<T> UnwindSafe for CoseCipherError<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more