#[non_exhaustive]pub enum TOTPError {
UrlFormat(ParseError),
IntFormat(ParseIntError),
MissingField(&'static str),
Time(SystemTimeError),
Base32,
NoRecord,
BadScheme(String),
BadAlgorithm(String),
}Expand description
Errors while processing a TOTP specification.
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.
UrlFormat(ParseError)
Errors parsing the TOTP URL.
IntFormat(ParseIntError)
Errors parsing integer fields in the TOTP URL.
MissingField(&'static str)
A required field is missing from the TOTP URL query parameters.
Time(SystemTimeError)
Errors related to getting system time.
Base32
Errors decoding the base32-encoded secret key.
NoRecord
No OTP record found in the entry.
BadScheme(String)
The URL scheme in the TOTP URL is not “otpauth”.
BadAlgorithm(String)
The hash algorithm specified in the TOTP URL is not recognized.
Trait Implementations§
Source§impl Error for TOTPError
impl Error for TOTPError
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<ParseError> for TOTPError
impl From<ParseError> for TOTPError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Source§impl From<ParseIntError> for TOTPError
impl From<ParseIntError> for TOTPError
Source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
Converts to this type from the input type.
Source§impl From<SystemTimeError> for TOTPError
impl From<SystemTimeError> for TOTPError
Source§fn from(source: SystemTimeError) -> Self
fn from(source: SystemTimeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for TOTPError
impl Freeze for TOTPError
impl Move for TOTPError
impl RefUnwindSafe for TOTPError
impl Send for TOTPError
impl Sync for TOTPErrorwhere
RawVecInner: Sync,
impl Unpin for TOTPError
impl UnsafeUnpin for TOTPError
impl UnwindSafe for TOTPError
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