pub struct UsageSummary {
pub input_tokens: Option<u64>,
pub output_tokens: Option<u64>,
pub reasoning_tokens: Option<u64>,
pub tool_calls: Option<u64>,
pub cost_micros_usd: Option<u64>,
}Fields§
§input_tokens: Option<u64>§output_tokens: Option<u64>§reasoning_tokens: Option<u64>§tool_calls: Option<u64>§cost_micros_usd: Option<u64>Implementations§
Source§impl UsageSummary
impl UsageSummary
Sourcepub fn input_tokens(&self) -> u64
pub fn input_tokens(&self) -> u64
Returns the value of input_tokens, or the default value if input_tokens is unset.
Sourcepub fn output_tokens(&self) -> u64
pub fn output_tokens(&self) -> u64
Returns the value of output_tokens, or the default value if output_tokens is unset.
Sourcepub fn reasoning_tokens(&self) -> u64
pub fn reasoning_tokens(&self) -> u64
Returns the value of reasoning_tokens, or the default value if reasoning_tokens is unset.
Sourcepub fn tool_calls(&self) -> u64
pub fn tool_calls(&self) -> u64
Returns the value of tool_calls, or the default value if tool_calls is unset.
Sourcepub fn cost_micros_usd(&self) -> u64
pub fn cost_micros_usd(&self) -> u64
Returns the value of cost_micros_usd, or the default value if cost_micros_usd is unset.
Trait Implementations§
Source§impl Clone for UsageSummary
impl Clone for UsageSummary
Source§fn clone(&self) -> UsageSummary
fn clone(&self) -> UsageSummary
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 moreimpl Copy for UsageSummary
Source§impl Debug for UsageSummary
impl Debug for UsageSummary
Source§impl Default for UsageSummary
impl Default for UsageSummary
impl Eq for UsageSummary
Source§impl Hash for UsageSummary
impl Hash for UsageSummary
Source§impl Message for UsageSummary
impl Message for UsageSummary
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for UsageSummary
impl PartialEq for UsageSummary
impl StructuralPartialEq for UsageSummary
Auto Trait Implementations§
impl Freeze for UsageSummary
impl RefUnwindSafe for UsageSummary
impl Send for UsageSummary
impl Sync for UsageSummary
impl Unpin for UsageSummary
impl UnsafeUnpin for UsageSummary
impl UnwindSafe for UsageSummary
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