pub struct UsageRow {
pub model: String,
pub display_model: String,
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
Data structure for a usage row.
output_tokens is the user-visible response the model emitted;
reasoning_tokens is the separately-billed “thinking” budget (Gemini
thoughts_tokens, Codex reasoning_output_tokens, Copilot
reasoningTokens). Display layers typically present their sum in a
single “Output” column via output_with_reasoning() so the per-row
numbers reconcile with total, while cost is computed against the
per-token reasoning rate (when the model publishes one) via
calculate_cost.
Fields§
§model: StringRaw model name as reported by the session (the pricing-lookup key).
display_model: StringName shown in the table; appends the fuzzy-matched pricing model in parentheses when the lookup was not exact.
input_tokens: i64Prompt (input) tokens.
output_tokens: i64User-visible response tokens, excluding reasoning.
reasoning_tokens: i64Separately-billed “thinking” tokens.
cache_read: i64Tokens served from the prompt cache.
cache_creation: i64Tokens written to the prompt cache.
total: i64Sum of all token buckets for this model.
cost: f64LiteLLM-priced cost in USD for this model’s tokens.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UsageRow
impl RefUnwindSafe for UsageRow
impl Send for UsageRow
impl Sync for UsageRow
impl Unpin for UsageRow
impl UnsafeUnpin for UsageRow
impl UnwindSafe for UsageRow
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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