pub struct UsageBucket {Show 18 fields
pub message_count: i64,
pub user_message_count: i64,
pub assistant_message_count: i64,
pub tool_call_count: i64,
pub plan_message_count: i64,
pub api_coverage_message_count: i64,
pub content_tokens_est_total: i64,
pub content_tokens_est_user: i64,
pub content_tokens_est_assistant: i64,
pub api_tokens_total: i64,
pub api_input_tokens_total: i64,
pub api_output_tokens_total: i64,
pub api_cache_read_tokens_total: i64,
pub api_cache_creation_tokens_total: i64,
pub api_thinking_tokens_total: i64,
pub plan_content_tokens_est_total: i64,
pub plan_api_tokens_total: i64,
pub estimated_cost_usd: f64,
}Expand description
A single bucket of aggregated token / message metrics.
Mirrors the columns of usage_daily / usage_hourly. Implements additive
merge() for re-bucketing (day → week, day → month).
Note: Eq is not derived because estimated_cost_usd is f64.
Fields§
§message_count: i64§user_message_count: i64§assistant_message_count: i64§tool_call_count: i64§plan_message_count: i64§api_coverage_message_count: i64§content_tokens_est_total: i64§content_tokens_est_user: i64§content_tokens_est_assistant: i64§api_tokens_total: i64§api_input_tokens_total: i64§api_output_tokens_total: i64§api_cache_read_tokens_total: i64§api_cache_creation_tokens_total: i64§api_thinking_tokens_total: i64§plan_content_tokens_est_total: i64§plan_api_tokens_total: i64§estimated_cost_usd: f64Estimated cost in USD from model pricing tables. Populated from Track B (token_daily_stats); 0.0 from Track A.
Implementations§
Source§impl UsageBucket
impl UsageBucket
Trait Implementations§
Source§impl Clone for UsageBucket
impl Clone for UsageBucket
Source§fn clone(&self) -> UsageBucket
fn clone(&self) -> UsageBucket
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 UsageBucket
impl Debug for UsageBucket
Source§impl Default for UsageBucket
impl Default for UsageBucket
Source§fn default() -> UsageBucket
fn default() -> UsageBucket
Returns the “default value” for a type. Read more
Source§impl PartialEq for UsageBucket
impl PartialEq for UsageBucket
Source§fn eq(&self, other: &UsageBucket) -> bool
fn eq(&self, other: &UsageBucket) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for UsageBucket
impl Serialize for UsageBucket
impl StructuralPartialEq for UsageBucket
Auto Trait Implementations§
impl Freeze for UsageBucket
impl RefUnwindSafe for UsageBucket
impl Send for UsageBucket
impl Sync for UsageBucket
impl Unpin for UsageBucket
impl UnsafeUnpin for UsageBucket
impl UnwindSafe for UsageBucket
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().