pub struct UsageTotals {
pub input_tokens: i64,
pub output_tokens: i64,
pub reasoning_tokens: i64,
pub cache_read: i64,
pub cache_creation: i64,
pub total: i64,
pub cost: f64,
}Expand description
Column-wise totals across every UsageRow in a summary.
Fields§
§input_tokens: i64Summed prompt (input) tokens.
output_tokens: i64Summed response tokens, excluding reasoning.
reasoning_tokens: i64Summed reasoning (“thinking”) tokens.
cache_read: i64Summed cache-read tokens.
cache_creation: i64Summed cache-creation tokens.
total: i64Summed total tokens.
cost: f64Summed cost in USD.
Implementations§
Source§impl UsageTotals
impl UsageTotals
Sourcepub fn accumulate(&mut self, row: &UsageRow)
pub fn accumulate(&mut self, row: &UsageRow)
Adds every token bucket and the cost of row into these totals.
Sourcepub fn output_with_reasoning(&self) -> i64
pub fn output_with_reasoning(&self) -> i64
Same helper as UsageRow::output_with_reasoning for totals.
Trait Implementations§
Source§impl Default for UsageTotals
impl Default for UsageTotals
Source§fn default() -> UsageTotals
fn default() -> UsageTotals
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for UsageTotals
impl RefUnwindSafe for UsageTotals
impl Send for UsageTotals
impl Sync for UsageTotals
impl Unpin for UsageTotals
impl UnsafeUnpin for UsageTotals
impl UnwindSafe for UsageTotals
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more