pub struct CredentialChain { /* private fields */ }Expand description
Ordered credential sources, with one selected identity retained during refresh.
Sources return None when unavailable. Errors stop discovery. Concurrent callers share
discovery and refresh, and a selected source is never replaced by another identity.
Implementations§
Source§impl CredentialChain
impl CredentialChain
Sourcepub fn new(providers: Vec<TokenSource>) -> Self
pub fn new(providers: Vec<TokenSource>) -> Self
Search these providers in order, stopping at the first usable credential.
Source§impl CredentialChain
impl CredentialChain
Sourcepub async fn token(&self) -> CredentialResult<Option<Token>>
pub async fn token(&self) -> CredentialResult<Option<Token>>
The selected source’s token, choosing the first source with credentials on first use.
Sourcepub async fn cached_token(&self) -> CredentialResult<Option<Token>>
pub async fn cached_token(&self) -> CredentialResult<Option<Token>>
The selected source’s unexpired token, without consulting any source.
Trait Implementations§
Source§impl Debug for CredentialChain
impl Debug for CredentialChain
Source§impl From<CredentialChain> for TokenSource
impl From<CredentialChain> for TokenSource
Source§fn from(provider: CredentialChain) -> Self
fn from(provider: CredentialChain) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for CredentialChain
impl !RefUnwindSafe for CredentialChain
impl !UnwindSafe for CredentialChain
impl Send for CredentialChain
impl Sync for CredentialChain
impl Unpin for CredentialChain
impl UnsafeUnpin for CredentialChain
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