pub struct Client<C: Config> { /* private fields */ }Expand description
Anthropic API client
The client is generic over a Config implementation that provides authentication
and API configuration.
Implementations§
Source§impl Client<AnthropicConfig>
impl Client<AnthropicConfig>
Source§impl<C: Config> Client<C>
impl<C: Config> Client<C>
Sourcepub fn with_config(config: C) -> Self
pub fn with_config(config: C) -> Self
Creates a new client with the given configuration.
§Panics
Panics if the reqwest client cannot be built.
Sourcepub fn with_http_client(self, http: Client) -> Self
pub fn with_http_client(self, http: Client) -> Self
Replaces the HTTP client with a custom one
Useful for setting custom timeouts, proxies, or other HTTP configuration.
Sourcepub const fn with_backoff(self, backoff: ExponentialBuilder) -> Self
pub const fn with_backoff(self, backoff: ExponentialBuilder) -> Self
Replaces the backoff configuration for retry logic
By default, the client uses exponential backoff with jitter.
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Client<C>where
C: Freeze,
impl<C> !RefUnwindSafe for Client<C>
impl<C> Send for Client<C>
impl<C> Sync for Client<C>
impl<C> Unpin for Client<C>where
C: Unpin,
impl<C> !UnwindSafe for Client<C>
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