pub struct EnvCredentialProvider { /* private fields */ }Expand description
Reads a credential from an environment variable on each call.
§Example
use synwire_core::credentials::EnvCredentialProvider;
let provider = EnvCredentialProvider::new("OPENAI_API_KEY");Implementations§
Trait Implementations§
Source§impl Clone for EnvCredentialProvider
impl Clone for EnvCredentialProvider
Source§fn clone(&self) -> EnvCredentialProvider
fn clone(&self) -> EnvCredentialProvider
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CredentialProvider for EnvCredentialProvider
impl CredentialProvider for EnvCredentialProvider
Source§fn get_credential(&self) -> BoxFuture<'_, Result<SecretValue, SynwireError>>
fn get_credential(&self) -> BoxFuture<'_, Result<SecretValue, SynwireError>>
Get the current credential value.
Source§fn refresh_credential(&self) -> BoxFuture<'_, Result<SecretValue, SynwireError>>
fn refresh_credential(&self) -> BoxFuture<'_, Result<SecretValue, SynwireError>>
Refresh the credential (e.g., after a 401/403 response). Read more
Auto Trait Implementations§
impl Freeze for EnvCredentialProvider
impl RefUnwindSafe for EnvCredentialProvider
impl Send for EnvCredentialProvider
impl Sync for EnvCredentialProvider
impl Unpin for EnvCredentialProvider
impl UnsafeUnpin for EnvCredentialProvider
impl UnwindSafe for EnvCredentialProvider
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