pub struct EnvToken { /* private fields */ }Expand description
A provider that reads a bare token from a named environment variable, at
request time. If the variable is unset/empty it yields None (fall back to
ambient auth) rather than erroring — handy for “use $MY_TOKEN if present”.
Implementations§
Trait Implementations§
Source§impl CredentialProvider for EnvToken
impl CredentialProvider for EnvToken
Source§fn credential<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_request: &'life1 CredentialRequest<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Option<Credential>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn credential<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_request: &'life1 CredentialRequest<'life2>,
) -> Pin<Box<dyn Future<Output = Result<Option<Credential>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Resolve the credential for
request, or Ok(None) to defer to ambient
auth. An Err aborts the operation (e.g. the vault was unreachable). Read moreAuto Trait Implementations§
impl Freeze for EnvToken
impl RefUnwindSafe for EnvToken
impl Send for EnvToken
impl Sync for EnvToken
impl Unpin for EnvToken
impl UnsafeUnpin for EnvToken
impl UnwindSafe for EnvToken
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