pub struct StaticCredentialProvider { /* private fields */ }Expand description
A credential provider that returns a fixed secret value.
Useful for testing or when the API key is known at construction time.
§Example
use synwire_core::credentials::{SecretValue, StaticCredentialProvider};
let provider = StaticCredentialProvider::new(SecretValue::new("sk-test"));Implementations§
Source§impl StaticCredentialProvider
impl StaticCredentialProvider
Sourcepub const fn new(secret: SecretValue) -> Self
pub const fn new(secret: SecretValue) -> Self
Creates a new provider with the given fixed secret.
Trait Implementations§
Source§impl Clone for StaticCredentialProvider
impl Clone for StaticCredentialProvider
Source§fn clone(&self) -> StaticCredentialProvider
fn clone(&self) -> StaticCredentialProvider
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 StaticCredentialProvider
impl CredentialProvider for StaticCredentialProvider
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 StaticCredentialProvider
impl RefUnwindSafe for StaticCredentialProvider
impl Send for StaticCredentialProvider
impl Sync for StaticCredentialProvider
impl Unpin for StaticCredentialProvider
impl UnsafeUnpin for StaticCredentialProvider
impl UnwindSafe for StaticCredentialProvider
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