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§impl Debug for SessionUsageSnapshot
impl Debug for SessionUsageSnapshot
Source§impl Default for SessionUsageSnapshot
impl Default for SessionUsageSnapshot
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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