pub struct TurnMetrics {
pub turn_index: usize,
pub prev_total: u32,
pub delta: u32,
pub is_heavy: bool,
pub is_active: bool,
pub context_compacted: bool,
pub cumulative_total: u32,
pub compaction_from: Option<u32>,
}Expand description
Computed context window metrics for turn visualization.
Used by TUI and other presentation layers to show cumulative token usage and detect high-usage patterns.
Fields§
§turn_index: usizeZero-based turn index.
prev_total: u32Cumulative tokens before this turn (0 if context was compacted).
delta: u32Tokens added by this turn (or new baseline if compacted).
is_heavy: boolWhether this turn’s delta exceeds the heavy threshold.
is_active: boolWhether this turn is currently active (in progress).
context_compacted: boolTrue if context was compacted (reset) during this turn.
cumulative_total: u32Actual cumulative tokens at end of this turn.
compaction_from: Option<u32>Previous cumulative tokens before compaction (only set when context_compacted is true). Used to visualize the reduction (e.g., 150k → 30k).
Implementations§
Source§impl TurnMetrics
impl TurnMetrics
Trait Implementations§
Source§impl Clone for TurnMetrics
impl Clone for TurnMetrics
Source§fn clone(&self) -> TurnMetrics
fn clone(&self) -> TurnMetrics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TurnMetrics
impl RefUnwindSafe for TurnMetrics
impl Send for TurnMetrics
impl Sync for TurnMetrics
impl Unpin for TurnMetrics
impl UnwindSafe for TurnMetrics
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