pub struct Usage {
pub input_tokens: u64,
pub output_tokens: u64,
pub cache_creation_input_tokens: u64,
pub cache_read_input_tokens: u64,
}Expand description
Token-usage breakdown. Names match Anthropic’s API field names so
the mapping stays obvious; OpenAI’s prompt_tokens /
completion_tokens will fan into input_tokens / output_tokens
when that adapter lands.
Verifying cache hits: if cache_read_input_tokens is zero
across repeated ask() calls with the same schema, something in
the prefix is invalidating the cache (a silent invalidator —
datetime.now() in a system block, varying tool list, etc.).
Fields§
§input_tokens: u64§output_tokens: u64§cache_creation_input_tokens: u64§cache_read_input_tokens: u64Trait Implementations§
Auto Trait Implementations§
impl Freeze for Usage
impl RefUnwindSafe for Usage
impl Send for Usage
impl Sync for Usage
impl Unpin for Usage
impl UnsafeUnpin for Usage
impl UnwindSafe for Usage
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