pub struct UsageIteration {
pub input_tokens: u32,
pub output_tokens: u32,
pub cache_read_input_tokens: Option<u32>,
pub cache_creation_input_tokens: Option<u32>,
pub cache_creation: Option<CacheCreationDetails>,
pub kind: Option<String>,
}Expand description
Usage for a single API call (“iteration”) within a turn’s tool-use loop.
Carried in UsageInfo::iterations. The cache fields are optional on
the wire: some frames carry only input_tokens + output_tokens
(observed with type: "turn"), while others carry the full cache
breakdown (observed with type: "message" in captured subagent
sessions). The CLI computes its context estimate from
input_tokens + output_tokens of the last iteration.
Fields§
§input_tokens: u32§output_tokens: u32§cache_read_input_tokens: Option<u32>Cache-read input tokens for this iteration, when carried.
cache_creation_input_tokens: Option<u32>Cache-write input tokens for this iteration, when carried.
cache_creation: Option<CacheCreationDetails>Cache-write breakdown by TTL, when carried.
kind: Option<String>Iteration kind; "turn" and "message" observed on the wire.
Trait Implementations§
Source§impl Clone for UsageIteration
impl Clone for UsageIteration
Source§fn clone(&self) -> UsageIteration
fn clone(&self) -> UsageIteration
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 UsageIteration
impl Debug for UsageIteration
Source§impl<'de> Deserialize<'de> for UsageIteration
impl<'de> Deserialize<'de> for UsageIteration
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
Auto Trait Implementations§
impl Freeze for UsageIteration
impl RefUnwindSafe for UsageIteration
impl Send for UsageIteration
impl Sync for UsageIteration
impl Unpin for UsageIteration
impl UnsafeUnpin for UsageIteration
impl UnwindSafe for UsageIteration
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