pub struct TokenSet { /* private fields */ }Expand description
An access/refresh token pair with its expiry instant.
Implementations§
Source§impl TokenSet
impl TokenSet
Sourcepub fn new(
access_token: impl Into<String>,
refresh_token: impl Into<String>,
expires_at: SystemTime,
) -> Self
pub fn new( access_token: impl Into<String>, refresh_token: impl Into<String>, expires_at: SystemTime, ) -> Self
Build a token set (e.g. from an authorization-code exchange you ran yourself).
Sourcepub fn access_token(&self) -> &str
pub fn access_token(&self) -> &str
The current access token (handle with care — this exposes the secret).
Sourcepub fn refresh_token(&self) -> &str
pub fn refresh_token(&self) -> &str
The current refresh token (handle with care — this exposes the secret).
Sourcepub fn expires_at(&self) -> SystemTime
pub fn expires_at(&self) -> SystemTime
When the access token expires.
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