pub struct ProviderApiKey { /* private fields */ }Expand description
Runtime API-key material for a provider adapter.
Hosts choose how to resolve and authorize this value. The wrapper only keeps accidental debug output redacted and reports missing configuration through the SDK error contract.
Implementations§
Source§impl ProviderApiKey
impl ProviderApiKey
Sourcepub fn new(value: impl Into<String>) -> Result<Self, AgentError>
pub fn new(value: impl Into<String>) -> Result<Self, AgentError>
Creates an API key from an already resolved host secret.
Sourcepub fn from_env(env_var: impl Into<String>) -> Result<Self, AgentError>
pub fn from_env(env_var: impl Into<String>) -> Result<Self, AgentError>
Resolves an API key from an environment variable.
Sourcepub fn source_label(&self) -> &str
pub fn source_label(&self) -> &str
Returns a non-secret source label suitable for diagnostics.
Trait Implementations§
Source§impl Clone for ProviderApiKey
impl Clone for ProviderApiKey
Source§fn clone(&self) -> ProviderApiKey
fn clone(&self) -> ProviderApiKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProviderApiKey
impl Debug for ProviderApiKey
Source§impl PartialEq for ProviderApiKey
impl PartialEq for ProviderApiKey
Source§fn eq(&self, other: &ProviderApiKey) -> bool
fn eq(&self, other: &ProviderApiKey) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ProviderApiKey
impl StructuralPartialEq for ProviderApiKey
Auto Trait Implementations§
impl Freeze for ProviderApiKey
impl RefUnwindSafe for ProviderApiKey
impl Send for ProviderApiKey
impl Sync for ProviderApiKey
impl Unpin for ProviderApiKey
impl UnsafeUnpin for ProviderApiKey
impl UnwindSafe for ProviderApiKey
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