pub struct AuthToken { /* private fields */ }Expand description
An opaque authentication token with expiry.
Uses SecretValue internally for in-memory protection.
Implementations§
Source§impl AuthToken
impl AuthToken
Sourcepub fn with_bytes<R>(&self, f: impl FnOnce(&[u8]) -> R) -> R
pub fn with_bytes<R>(&self, f: impl FnOnce(&[u8]) -> R) -> R
Scoped exposure of the token bytes.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if this token has expired.
Sourcepub fn expires_at(&self) -> Option<SystemTime>
pub fn expires_at(&self) -> Option<SystemTime>
Returns when this token expires, if known.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuthToken
impl RefUnwindSafe for AuthToken
impl Send for AuthToken
impl Sync for AuthToken
impl Unpin for AuthToken
impl UnsafeUnpin for AuthToken
impl UnwindSafe for AuthToken
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