pub struct TokenUsage {
pub input_tokens: u64,
pub output_tokens: u64,
pub cached_input_tokens: u64,
pub reasoning_output_tokens: u64,
pub last_input_tokens: Option<u64>,
pub last_output_tokens: Option<u64>,
}Expand description
Normalized cumulative and latest-turn token accounting.
Fields§
§input_tokens: u64Cumulative input tokens for the thread.
output_tokens: u64Cumulative output tokens for the thread, including reasoning output.
cached_input_tokens: u64Cumulative cached input tokens for the thread.
reasoning_output_tokens: u64Cumulative reasoning output tokens for the thread.
last_input_tokens: Option<u64>Input tokens for the latest model round.
last_output_tokens: Option<u64>Output tokens for the latest model round.
Trait Implementations§
Source§impl Clone for TokenUsage
impl Clone for TokenUsage
Source§fn clone(&self) -> TokenUsage
fn clone(&self) -> TokenUsage
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 moreSource§impl Debug for TokenUsage
impl Debug for TokenUsage
Source§impl Default for TokenUsage
impl Default for TokenUsage
Source§fn default() -> TokenUsage
fn default() -> TokenUsage
Returns the “default value” for a type. Read more
impl Eq for TokenUsage
Source§impl PartialEq for TokenUsage
impl PartialEq for TokenUsage
impl StructuralPartialEq for TokenUsage
Auto Trait Implementations§
impl Freeze for TokenUsage
impl RefUnwindSafe for TokenUsage
impl Send for TokenUsage
impl Sync for TokenUsage
impl Unpin for TokenUsage
impl UnsafeUnpin for TokenUsage
impl UnwindSafe for TokenUsage
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