pub struct TurnStatsAccum {
pub cumulative_input: u64,
pub cumulative_output: u64,
pub turn_count: u64,
}Expand description
Internal accumulator for per-session cumulative token counts. Distinct
from the wire-form UiEvent::TurnStats (which also carries per-turn
deltas + model). See spec §3.1 and §3.4.
Fields§
§cumulative_input: u64§cumulative_output: u64§turn_count: u64Implementations§
Source§impl TurnStatsAccum
impl TurnStatsAccum
Sourcepub fn add(&mut self, usage: TokenUsage)
pub fn add(&mut self, usage: TokenUsage)
Add a TokenUsage from a completed turn. Saturating arithmetic
— u64::MAX is the cap (overflow is practically unreachable
at realistic token counts).
Trait Implementations§
Source§impl Clone for TurnStatsAccum
impl Clone for TurnStatsAccum
Source§fn clone(&self) -> TurnStatsAccum
fn clone(&self) -> TurnStatsAccum
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 TurnStatsAccum
impl Debug for TurnStatsAccum
Source§impl Default for TurnStatsAccum
impl Default for TurnStatsAccum
Source§fn default() -> TurnStatsAccum
fn default() -> TurnStatsAccum
Returns the “default value” for a type. Read more
Source§impl PartialEq for TurnStatsAccum
impl PartialEq for TurnStatsAccum
Source§fn eq(&self, other: &TurnStatsAccum) -> bool
fn eq(&self, other: &TurnStatsAccum) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for TurnStatsAccum
impl Eq for TurnStatsAccum
impl StructuralPartialEq for TurnStatsAccum
Auto Trait Implementations§
impl Freeze for TurnStatsAccum
impl RefUnwindSafe for TurnStatsAccum
impl Send for TurnStatsAccum
impl Sync for TurnStatsAccum
impl Unpin for TurnStatsAccum
impl UnsafeUnpin for TurnStatsAccum
impl UnwindSafe for TurnStatsAccum
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.