pub struct TwoFactorChallenge { /* private fields */ }Expand description
Server-issued pending two-factor login challenge.
Its custom fmt::Debug implementation redacts the challenge token.
Implementations§
Source§impl TwoFactorChallenge
impl TwoFactorChallenge
Sourcepub fn new(account_id: String) -> Self
pub fn new(account_id: String) -> Self
Issues a fresh challenge for an account at the current UTC time.
Sourcepub fn account_id(&self) -> &str
pub fn account_id(&self) -> &str
Returns the account associated with this challenge.
Sourcepub fn is_expired(&self, now: OffsetDateTime) -> bool
pub fn is_expired(&self, now: OffsetDateTime) -> bool
Reports whether the challenge is older than TWO_FACTOR_TTL at now.
Trait Implementations§
Source§impl Clone for TwoFactorChallenge
impl Clone for TwoFactorChallenge
Source§impl Debug for TwoFactorChallenge
impl Debug for TwoFactorChallenge
Source§impl<'de> Deserialize<'de> for TwoFactorChallenge
impl<'de> Deserialize<'de> for TwoFactorChallenge
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TwoFactorChallenge
Source§impl PartialEq for TwoFactorChallenge
impl PartialEq for TwoFactorChallenge
Source§impl Serialize for TwoFactorChallenge
impl Serialize for TwoFactorChallenge
impl StructuralPartialEq for TwoFactorChallenge
Auto Trait Implementations§
impl Freeze for TwoFactorChallenge
impl RefUnwindSafe for TwoFactorChallenge
impl Send for TwoFactorChallenge
impl Sync for TwoFactorChallenge
impl Unpin for TwoFactorChallenge
impl UnsafeUnpin for TwoFactorChallenge
impl UnwindSafe for TwoFactorChallenge
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