pub struct AuthHandler { /* private fields */ }Expand description
Authentication handler for Anthropic API and compatible gateways
Implementations§
Source§impl AuthHandler
impl AuthHandler
Sourcepub fn new(api_key: String) -> Self
pub fn new(api_key: String) -> Self
Create a new auth handler with standard Anthropic authentication
Sourcepub fn new_bearer(api_key: String) -> Self
pub fn new_bearer(api_key: String) -> Self
Create a new auth handler with Bearer token authentication
Sourcepub fn with_method(api_key: String, auth_method: AuthMethod) -> Self
pub fn with_method(api_key: String, auth_method: AuthMethod) -> Self
Create a new auth handler with specified method
Sourcepub fn add_auth_headers(&self, headers: &mut HeaderMap) -> Result<()>
pub fn add_auth_headers(&self, headers: &mut HeaderMap) -> Result<()>
Add authentication headers to the request
Trait Implementations§
Source§impl Clone for AuthHandler
impl Clone for AuthHandler
Source§fn clone(&self) -> AuthHandler
fn clone(&self) -> AuthHandler
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 moreAuto Trait Implementations§
impl Freeze for AuthHandler
impl RefUnwindSafe for AuthHandler
impl Send for AuthHandler
impl Sync for AuthHandler
impl Unpin for AuthHandler
impl UnsafeUnpin for AuthHandler
impl UnwindSafe for AuthHandler
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