Struct cloud_storage::Token
source · [−]pub struct Token { /* private fields */ }
Expand description
This struct contains a token, an expiry, and an access scope.
Trait Implementations
sourceimpl TokenCache for Token
impl TokenCache for Token
sourcefn scope<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn scope<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns the intended scope for the current token.
sourcefn token_and_exp<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Option<(String, u64)>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn token_and_exp<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Option<(String, u64)>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: '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). Read more
sourcefn set_token<'life0, 'async_trait>(
&'life0 self,
token: String,
exp: u64
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn set_token<'life0, 'async_trait>(
&'life0 self,
token: String,
exp: u64
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Updates the token to the value token
.
sourcefn fetch_token<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 Client
) -> Pin<Box<dyn Future<Output = Result<(String, u64)>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Fetches and returns the token using the service account
sourcefn get<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 Client
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
client: &'life1 Client
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Returns a valid, unexpired token. If the contained token is expired, it updates and returns the token. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more