pub struct AuthProviderChain { /* private fields */ }Expand description
Tries providers in order until one succeeds.
Implementations§
Source§impl AuthProviderChain
impl AuthProviderChain
Sourcepub fn with_provider(self, provider: Arc<dyn AuthProvider>) -> Self
pub fn with_provider(self, provider: Arc<dyn AuthProvider>) -> Self
Add a provider to the end of the chain.
Sourcepub fn add(&mut self, provider: Arc<dyn AuthProvider>)
pub fn add(&mut self, provider: Arc<dyn AuthProvider>)
Add a provider to the end of the chain (mutable).
Trait Implementations§
Source§impl AuthProvider for AuthProviderChain
impl AuthProvider for AuthProviderChain
Source§fn provide<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 AuthRequest,
) -> Pin<Box<dyn Future<Output = Result<AuthToken, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn provide<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 AuthRequest,
) -> Pin<Box<dyn Future<Output = Result<AuthToken, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provide an authentication token for the given request context.
Auto Trait Implementations§
impl Freeze for AuthProviderChain
impl !RefUnwindSafe for AuthProviderChain
impl Send for AuthProviderChain
impl Sync for AuthProviderChain
impl Unpin for AuthProviderChain
impl UnsafeUnpin for AuthProviderChain
impl !UnwindSafe for AuthProviderChain
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