pub struct Token { /* private fields */ }
Expand description
This struct contains a token, an expiry, and an access scope.
Trait Implementations§
Source§impl TokenCache for Token
impl TokenCache for Token
Source§fn scope<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn scope<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the intended scope for the current token.
Source§fn token_and_exp<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<(String, u64)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn token_and_exp<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<(String, u64)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the token that is currently held within the instance of
TokenCache
, together with
the expiry of that token as a u64 in seconds sine the Unix Epoch (1 Jan 1970).Source§fn set_token<'life0, 'async_trait>(
&'life0 self,
token: String,
exp: u64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_token<'life0, 'async_trait>(
&'life0 self,
token: String,
exp: u64,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Updates the token to the value
token
.Source§fn fetch_token<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 Client,
) -> Pin<Box<dyn Future<Output = Result<(String, u64)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_token<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 Client,
) -> Pin<Box<dyn Future<Output = Result<(String, u64)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetches and returns the token using the service account
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 Client,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 Client,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns a valid, unexpired token. If the contained token is expired, it updates and returns
the token.
Auto Trait Implementations§
impl !Freeze for Token
impl !RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl !UnwindSafe for Token
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