pub enum Error {
InvalidInput(&'static str),
InconsistentPsk,
MissingPsk,
UnnecessaryPsk,
InsecurePsk,
MessageLimitReached,
CryptoError(CryptoError),
}Expand description
HPKE Error types.
Variants§
InvalidInput(&'static str)
Generic invalid input.
InconsistentPsk
Inconsistent PSK input.
MissingPsk
PSK input is required but missing.
UnnecessaryPsk
PSK input is provided but not needed.
InsecurePsk
PSK input is too short (needs to be at least 32 bytes).
MessageLimitReached
The message limit for this AEAD, key, and nonce.
CryptoError(CryptoError)
Error passed from the underlying crypto implementation.
Implementations§
Source§impl Error
impl Error
Sourcepub const fn is_invalid_input(&self) -> bool
pub const fn is_invalid_input(&self) -> bool
Returns true if the error is Error::InvalidInput.
Sourcepub const fn is_unsupported_kem(&self) -> bool
pub const fn is_unsupported_kem(&self) -> bool
Returns true if the error is due to the crypto backend not supporting the requested KEM.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 From<CryptoError> for Error
impl From<CryptoError> for Error
Source§fn from(e: CryptoError) -> Self
fn from(e: CryptoError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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