pub struct TokenSet {
pub access_token: Secret,
pub refresh_token: Option<Secret>,
pub token_type: String,
pub expires_at: Option<OffsetDateTime>,
pub scopes: Vec<String>,
}Expand description
The credentials of one authenticated account.
Fields§
§access_token: Secret§refresh_token: Option<Secret>Absent when the provider issues no refresh token — the user then has to re-authenticate once the access token expires.
token_type: String§expires_at: Option<OffsetDateTime>Absent when the provider does not say; such tokens are treated as long-lived.
scopes: Vec<String>Scopes the provider actually granted, which can be fewer than requested.
Implementations§
Source§impl TokenSet
impl TokenSet
Sourcepub fn expires_within(&self, clock: &dyn Clock, skew: Duration) -> bool
pub fn expires_within(&self, clock: &dyn Clock, skew: Duration) -> bool
Whether the access token is expired, or will be within skew.
The skew matters: a token that is valid for another two seconds when checked will be rejected by the time the request arrives.
pub fn can_refresh(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TokenSet
impl RefUnwindSafe for TokenSet
impl Send for TokenSet
impl Sync for TokenSet
impl Unpin for TokenSet
impl UnsafeUnpin for TokenSet
impl UnwindSafe for TokenSet
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