Skip to main content

AgentUsage

Struct AgentUsage 

Source
pub struct AgentUsage {
Show 38 fields pub session_5h_tokens: u64, pub session_5h_percent: Option<f64>, pub week_7d_tokens: u64, pub week_7d_percent: Option<f64>, pub cache_read_tokens_5h: u64, pub cache_read_tokens_7d: u64, pub cache_read_tokens_30d: u64, pub active_session_tokens: u64, pub active_session_cost: f64, pub active_session_file: Option<String>, pub last_turn_input_tokens: u64, pub last_turn_output_tokens: u64, pub last_model: Option<String>, pub last_context_window: Option<u64>, pub last_context_pct: Option<f64>, pub last_turn_at: Option<String>, pub last_cwd: Option<String>, pub active_session_started_at: Option<String>, pub total_tokens_30d: u64, pub total_sessions_30d: u64, pub max_session_minutes: f64, pub cost_5h: f64, pub cost_7d: f64, pub cost_today: f64, pub total_cost_30d: f64, pub total_input_30d: u64, pub total_output_30d: u64, pub cache_savings_30d: f64, pub by_day: Vec<TimeBucket>, pub by_week: Vec<TimeBucket>, pub by_month: Vec<TimeBucket>, pub by_model: Vec<NamedBucket>, pub by_project: Vec<NamedBucket>, pub by_day_project: Vec<DailyInstance>, pub recent_sessions: Vec<SessionRecord>, pub active_sessions: Vec<ActiveSession>, pub session_5h_resets_at: Option<String>, pub week_7d_resets_at: Option<String>,
}

Fields§

§session_5h_tokens: u64§session_5h_percent: Option<f64>§week_7d_tokens: u64§week_7d_percent: Option<f64>§cache_read_tokens_5h: u64§cache_read_tokens_7d: u64§cache_read_tokens_30d: u64§active_session_tokens: u64§active_session_cost: f64§active_session_file: Option<String>§last_turn_input_tokens: u64§last_turn_output_tokens: u64§last_model: Option<String>§last_context_window: Option<u64>§last_context_pct: Option<f64>§last_turn_at: Option<String>§last_cwd: Option<String>§active_session_started_at: Option<String>§total_tokens_30d: u64§total_sessions_30d: u64§max_session_minutes: f64§cost_5h: f64§cost_7d: f64§cost_today: f64§total_cost_30d: f64§total_input_30d: u64§total_output_30d: u64§cache_savings_30d: f64

Net USD prompt caching saved over the 30-day window vs paying full input.

§by_day: Vec<TimeBucket>§by_week: Vec<TimeBucket>§by_month: Vec<TimeBucket>§by_model: Vec<NamedBucket>§by_project: Vec<NamedBucket>§by_day_project: Vec<DailyInstance>§recent_sessions: Vec<SessionRecord>§active_sessions: Vec<ActiveSession>§session_5h_resets_at: Option<String>§week_7d_resets_at: Option<String>

Trait Implementations§

Source§

impl Clone for AgentUsage

Source§

fn clone(&self) -> AgentUsage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AgentUsage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for AgentUsage

Source§

fn default() -> AgentUsage

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for AgentUsage

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<AgentUsage, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for AgentUsage

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,