pub struct ApiKeyAuth { /* private fields */ }Expand description
API key based authentication
Implementations§
Source§impl ApiKeyAuth
impl ApiKeyAuth
Sourcepub fn new(api_key: Option<String>, source: AuthSource) -> Self
pub fn new(api_key: Option<String>, source: AuthSource) -> Self
Create a new API key auth with the given key and source.
Trait Implementations§
Source§impl Clone for ApiKeyAuth
impl Clone for ApiKeyAuth
Source§fn clone(&self) -> ApiKeyAuth
fn clone(&self) -> ApiKeyAuth
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 ApiKeyAuth
impl Debug for ApiKeyAuth
Source§impl ProviderAuth for ApiKeyAuth
impl ProviderAuth for ApiKeyAuth
Source§fn provider_name(&self) -> &str
fn provider_name(&self) -> &str
Get the provider name
Source§fn is_configured(&self) -> bool
fn is_configured(&self) -> bool
Check if auth is configured (API key, OAuth, or ambient)
Source§fn get_api_key(&self) -> Option<String>
fn get_api_key(&self) -> Option<String>
Get the current API key (may involve refresh for OAuth)
Source§fn needs_oauth_refresh(&self) -> bool
fn needs_oauth_refresh(&self) -> bool
Check if OAuth is configured and needs refresh
Source§fn get_oauth_token(&self) -> Option<OAuthTokenInfo>
fn get_oauth_token(&self) -> Option<OAuthTokenInfo>
Get OAuth token info
Source§fn set_oauth_token(&mut self, _token: OAuthTokenInfo)
fn set_oauth_token(&mut self, _token: OAuthTokenInfo)
Set OAuth token
Source§fn set_api_key(&mut self, api_key: String)
fn set_api_key(&mut self, api_key: String)
Set API key directly
Auto Trait Implementations§
impl Freeze for ApiKeyAuth
impl RefUnwindSafe for ApiKeyAuth
impl Send for ApiKeyAuth
impl Sync for ApiKeyAuth
impl Unpin for ApiKeyAuth
impl UnsafeUnpin for ApiKeyAuth
impl UnwindSafe for ApiKeyAuth
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