pub struct StaticCredential(/* private fields */);Expand description
A fixed secret.
Implementations§
Source§impl StaticCredential
impl StaticCredential
pub fn new(secret: impl Into<String>) -> Self
Sourcepub fn from_credential(credential: Credential) -> Self
pub fn from_credential(credential: Credential) -> Self
A fixed, fully specified credential (headers, base URL, expiry).
Trait Implementations§
Source§impl Clone for StaticCredential
impl Clone for StaticCredential
Source§impl CredentialSource for StaticCredential
impl CredentialSource for StaticCredential
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.Auto Trait Implementations§
impl Forget for StaticCredential
impl Freeze for StaticCredential
impl Move for StaticCredential
impl RefUnwindSafe for StaticCredential
impl Send for StaticCredential
impl Sync for StaticCredential
impl Unpin for StaticCredential
impl UnsafeUnpin for StaticCredential
impl UnwindSafe for StaticCredential
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