pub struct SessionUsageSnapshot {
pub input_tokens: u64,
pub output_tokens: u64,
pub cost_usd: f64,
pub cost_known: bool,
pub credits_spent: Option<f64>,
pub credit_unit: Option<String>,
}Expand description
Accumulated token/cost usage for a session (persisted with the snapshot).
Fields§
§input_tokens: u64Cumulative prompt/context tokens billed this session.
output_tokens: u64Cumulative completion tokens billed this session.
cost_usd: f64Estimated spend in USD from list rates × tokens (when known).
cost_known: boolTrue once at least one turn had usable list pricing.
credits_spent: Option<f64>Estimated prepaid credits spent (e.g. Hypercredits = USD / $0.05).
credit_unit: Option<String>Credit unit label when credits_spent is set (e.g. hypercredits).
Trait Implementations§
Source§impl Clone for SessionUsageSnapshot
impl Clone for SessionUsageSnapshot
Source§fn clone(&self) -> SessionUsageSnapshot
fn clone(&self) -> SessionUsageSnapshot
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 SessionUsageSnapshot
impl Debug for SessionUsageSnapshot
Source§impl Default for SessionUsageSnapshot
impl Default for SessionUsageSnapshot
Source§fn default() -> SessionUsageSnapshot
fn default() -> SessionUsageSnapshot
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SessionUsageSnapshot
impl<'de> Deserialize<'de> for SessionUsageSnapshot
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
Source§impl PartialEq for SessionUsageSnapshot
impl PartialEq for SessionUsageSnapshot
Source§impl Serialize for SessionUsageSnapshot
impl Serialize for SessionUsageSnapshot
impl StructuralPartialEq for SessionUsageSnapshot
Auto Trait Implementations§
impl Freeze for SessionUsageSnapshot
impl RefUnwindSafe for SessionUsageSnapshot
impl Send for SessionUsageSnapshot
impl Sync for SessionUsageSnapshot
impl Unpin for SessionUsageSnapshot
impl UnsafeUnpin for SessionUsageSnapshot
impl UnwindSafe for SessionUsageSnapshot
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