pub struct TokenProviderChain { /* private fields */ }
Expand description
Access token provider that checks a series of inner providers.
Each provider will be evaluated in order:
- If a provider returns valid
Token
they will be returned immediately. No other token providers will be used. - Otherwise, if a provider returns
TokenError::TokenNotLoaded
, the next provider will be checked. - Finally, if a provider returns any other error condition, an error will be returned immediately.
Implementations§
source§impl TokenProviderChain
impl TokenProviderChain
Trait Implementations§
source§impl Debug for TokenProviderChain
impl Debug for TokenProviderChain
source§impl ProvideToken for TokenProviderChain
impl ProvideToken for TokenProviderChain
source§fn provide_token<'a>(&'a self) -> ProvideToken<'_>where
Self: 'a,
fn provide_token<'a>(&'a self) -> ProvideToken<'_>where
Self: 'a,
Returns a future that provides an access token.
Auto Trait Implementations§
impl Freeze for TokenProviderChain
impl !RefUnwindSafe for TokenProviderChain
impl Send for TokenProviderChain
impl Sync for TokenProviderChain
impl Unpin for TokenProviderChain
impl !UnwindSafe for TokenProviderChain
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.