pub struct ApiClient { /* private fields */ }Implementations§
Source§impl AnthropicClient
impl AnthropicClient
pub fn new(api_key: impl Into<String>) -> Self
pub fn from_auth(auth: AuthSource) -> Self
pub fn from_env() -> Result<Self, ApiError>
pub fn with_auth_source(self, auth: AuthSource) -> Self
pub fn with_auth_token(self, auth_token: Option<String>) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_retry_policy( self, max_retries: u32, initial_backoff: Duration, max_backoff: Duration, ) -> Self
pub fn auth_source(&self) -> &AuthSource
pub async fn send_message( &self, request: &MessageRequest, ) -> Result<MessageResponse, ApiError>
pub async fn stream_message( &self, request: &MessageRequest, ) -> Result<MessageStream, ApiError>
pub async fn exchange_oauth_code( &self, config: &OAuthConfig, request: &OAuthTokenExchangeRequest, ) -> Result<OAuthTokenSet, ApiError>
pub async fn refresh_oauth_token( &self, config: &OAuthConfig, request: &OAuthRefreshRequest, ) -> Result<OAuthTokenSet, ApiError>
Trait Implementations§
Source§impl Clone for AnthropicClient
impl Clone for AnthropicClient
Source§fn clone(&self) -> AnthropicClient
fn clone(&self) -> AnthropicClient
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 moreAuto Trait Implementations§
impl Freeze for AnthropicClient
impl !RefUnwindSafe for AnthropicClient
impl Send for AnthropicClient
impl Sync for AnthropicClient
impl Unpin for AnthropicClient
impl UnsafeUnpin for AnthropicClient
impl !UnwindSafe for AnthropicClient
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