pub struct TerminalUsage {
pub input: u64,
pub output: u64,
pub cached_read: u64,
pub cache_write: u64,
}Expand description
The four usage counters as they appear on a canonical chunk’s usage block
(input/completion/cached-read/cache-write), named because they recur at
several terminal-frame sites. pending_usage uses this; compute paths may
also build it ad hoc from a fresh usage payload.
Fields§
§input: u64§output: u64§cached_read: u64§cache_write: u64Implementations§
Source§impl TerminalUsage
impl TerminalUsage
Sourcepub fn from_usage(u: &Usage) -> Self
pub fn from_usage(u: &Usage) -> Self
From the typed canonical Usage. Ignores reasoning_tokens — Anthropic’s wire has no slot for it (it’s folded into output_tokens upstream).
Trait Implementations§
Source§impl Clone for TerminalUsage
impl Clone for TerminalUsage
Source§fn clone(&self) -> TerminalUsage
fn clone(&self) -> TerminalUsage
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 TerminalUsage
Source§impl Debug for TerminalUsage
impl Debug for TerminalUsage
Source§impl Default for TerminalUsage
impl Default for TerminalUsage
Source§fn default() -> TerminalUsage
fn default() -> TerminalUsage
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TerminalUsage
impl RefUnwindSafe for TerminalUsage
impl Send for TerminalUsage
impl Sync for TerminalUsage
impl Unpin for TerminalUsage
impl UnsafeUnpin for TerminalUsage
impl UnwindSafe for TerminalUsage
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