pub struct EnvCredentials { /* private fields */ }Expand description
Reads keys from environment variables at request time (servers), so rotating the variable in a supervisor takes effect without rebuilding the registry.
Implementations§
Trait Implementations§
Source§impl Clone for EnvCredentials
impl Clone for EnvCredentials
Source§impl CredentialSource for EnvCredentials
impl CredentialSource for EnvCredentials
Source§fn credential<'a>(
&'a self,
provider: &'a str,
) -> BoxFuture<'a, Result<Credential, LlmError>>
fn credential<'a>( &'a self, provider: &'a str, ) -> BoxFuture<'a, Result<Credential, LlmError>>
Credential for
provider (the registry name, e.g. openai).Source§fn invalidate(&self, provider: &str)
fn invalidate(&self, provider: &str)
Called when the provider rejected the last credential (HTTP 401/403), so
cached values can be dropped before one retry.
Source§fn generation(&self) -> u64
fn generation(&self) -> u64
A counter that changes whenever credentials this source would return for
any provider may have changed outside of
CredentialSource::invalidate
(e.g. the host app signed a user out or registered a new key source).
CachedCredentials drops cached values when it changes. Default: never changes.Source§impl Debug for EnvCredentials
impl Debug for EnvCredentials
Auto Trait Implementations§
impl Forget for EnvCredentials
impl Freeze for EnvCredentials
impl Move for EnvCredentials
impl RefUnwindSafe for EnvCredentials
impl Send for EnvCredentials
impl Sync for EnvCredentials
impl Unpin for EnvCredentials
impl UnsafeUnpin for EnvCredentials
impl UnwindSafe for EnvCredentials
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