pub enum ClaudeCountTokensResponse {
Success {
stats_code: StatusCode,
headers: ClaudeResponseHeaders,
body: ResponseBody,
},
Error {
stats_code: StatusCode,
headers: ClaudeResponseHeaders,
body: BetaErrorResponse,
},
}Expand description
Full HTTP response for Claude “Count Tokens” endpoint.
Variants§
Success
Fields
§
stats_code: StatusCodeHTTP status code returned by server (should be 200 OK).
§
headers: ClaudeResponseHeadersResponse headers.
§
body: ResponseBodySuccessful body.
Error
Fields
§
stats_code: StatusCodeHTTP status code returned by server (typically 400/401/403/404/413/429/500/529).
§
headers: ClaudeResponseHeadersResponse headers.
§
body: BetaErrorResponseError body.
Trait Implementations§
Source§impl Clone for ClaudeCountTokensResponse
impl Clone for ClaudeCountTokensResponse
Source§fn clone(&self) -> ClaudeCountTokensResponse
fn clone(&self) -> ClaudeCountTokensResponse
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 moreSource§impl Debug for ClaudeCountTokensResponse
impl Debug for ClaudeCountTokensResponse
Source§impl<'de> Deserialize<'de> for ClaudeCountTokensResponse
impl<'de> Deserialize<'de> for ClaudeCountTokensResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl TryFrom<ClaudeCountTokensResponse> for GeminiCountTokensResponse
impl TryFrom<ClaudeCountTokensResponse> for GeminiCountTokensResponse
Source§type Error = TransformError
type Error = TransformError
The type returned in the event of a conversion error.
Source§fn try_from(value: ClaudeCountTokensResponse) -> Result<Self, TransformError>
fn try_from(value: ClaudeCountTokensResponse) -> Result<Self, TransformError>
Performs the conversion.
Source§impl TryFrom<ClaudeCountTokensResponse> for OpenAiCountTokensResponse
impl TryFrom<ClaudeCountTokensResponse> for OpenAiCountTokensResponse
Source§type Error = TransformError
type Error = TransformError
The type returned in the event of a conversion error.
Source§fn try_from(value: ClaudeCountTokensResponse) -> Result<Self, TransformError>
fn try_from(value: ClaudeCountTokensResponse) -> Result<Self, TransformError>
Performs the conversion.
Source§impl TryFrom<GeminiCountTokensResponse> for ClaudeCountTokensResponse
impl TryFrom<GeminiCountTokensResponse> for ClaudeCountTokensResponse
Source§type Error = TransformError
type Error = TransformError
The type returned in the event of a conversion error.
Source§fn try_from(value: GeminiCountTokensResponse) -> Result<Self, TransformError>
fn try_from(value: GeminiCountTokensResponse) -> Result<Self, TransformError>
Performs the conversion.
Source§impl TryFrom<OpenAiCountTokensResponse> for ClaudeCountTokensResponse
impl TryFrom<OpenAiCountTokensResponse> for ClaudeCountTokensResponse
Source§type Error = TransformError
type Error = TransformError
The type returned in the event of a conversion error.
Source§fn try_from(value: OpenAiCountTokensResponse) -> Result<Self, TransformError>
fn try_from(value: OpenAiCountTokensResponse) -> Result<Self, TransformError>
Performs the conversion.
impl StructuralPartialEq for ClaudeCountTokensResponse
Auto Trait Implementations§
impl Freeze for ClaudeCountTokensResponse
impl RefUnwindSafe for ClaudeCountTokensResponse
impl Send for ClaudeCountTokensResponse
impl Sync for ClaudeCountTokensResponse
impl Unpin for ClaudeCountTokensResponse
impl UnsafeUnpin for ClaudeCountTokensResponse
impl UnwindSafe for ClaudeCountTokensResponse
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