pub enum Error {
Expired(DateTime<Utc>),
JsonSerialize(Error),
JsonDeserialize(Error),
InvalidExpirationSeconds(i64),
ExpirationOutOfRange(i64),
PasswordHash(Error),
MissingHash,
AesGcm(Error),
Base64Decode(DecodeError),
Utf8(FromUtf8Error),
InvalidDataLength(usize),
}Expand description
Defines possible errors
Variants§
Expired(DateTime<Utc>)
The Token is expired at the date time
JsonSerialize(Error)
JSON serialization failed
JsonDeserialize(Error)
JSON deserialization failed
InvalidExpirationSeconds(i64)
The requested expiration was invalid (<= 1s)
ExpirationOutOfRange(i64)
Expiration timestamp was out of range for Utc.timestamp_opt
PasswordHash(Error)
Something went wrong with password hashing (salt‐encode or hash_password)
MissingHash
We got a PHC string back, but it had no .hash component
AesGcm(Error)
AES‐GCM encryption/decryption error
Base64Decode(DecodeError)
Base64 decoding failed
Utf8(FromUtf8Error)
UTF‑8 decoding (after decryption) failed
InvalidDataLength(usize)
Encrypted blob was too short to contain salt and nonce
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + '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<DecodeError> for Error
impl From<DecodeError> for Error
Source§fn from(e: Base64DecodeError) -> Error
fn from(e: Base64DecodeError) -> Error
Converts to this type from the input type.
Source§impl From<Error> for Error
impl From<Error> for Error
Source§fn from(e: AesGcmError) -> Error
fn from(e: AesGcmError) -> Error
Converts to this type from the input type.
Source§impl From<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
Source§fn from(e: FromUtf8Error) -> Error
fn from(e: FromUtf8Error) -> Error
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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