pub struct ThreadContextSnapshot {
pub estimated_input_tokens: usize,
pub context_window_tokens: u32,
pub usage_percent: f64,
pub message_count: usize,
pub compaction_enabled: bool,
pub compaction_threshold_tokens: usize,
pub compaction_floor_tokens: usize,
pub should_compact: bool,
pub last_api_input_tokens: Option<u32>,
pub last_api_usage_percent: Option<f64>,
pub last_reported_input_tokens: Option<u32>,
pub source: String,
}Expand description
Context fill + compaction policy snapshot for a thread.
Fields§
§estimated_input_tokens: usizeConservative estimate (estimate_input_tokens_conservative) for
compaction / overflow.
context_window_tokens: u32§usage_percent: f64Percent from conservative estimate (primary UI ring).
message_count: usize§compaction_enabled: bool§compaction_threshold_tokens: usize§compaction_floor_tokens: usize§should_compact: bool§last_api_input_tokens: Option<u32>Provider usage.input_tokens from the last API round (authoritative
per DeepSeek docs).
last_api_usage_percent: Option<f64>Percent from last_api_input_tokens when present.
last_reported_input_tokens: Option<u32>Deprecated: last turn’s summed usage.input_tokens (multi-round
turns inflate).
source: Stringengine when read from a loaded engine; store when reconstructed
from persisted turns.
Trait Implementations§
Source§impl Clone for ThreadContextSnapshot
impl Clone for ThreadContextSnapshot
Source§fn clone(&self) -> ThreadContextSnapshot
fn clone(&self) -> ThreadContextSnapshot
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 ThreadContextSnapshot
impl Debug for ThreadContextSnapshot
Source§impl<'de> Deserialize<'de> for ThreadContextSnapshot
impl<'de> Deserialize<'de> for ThreadContextSnapshot
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 ThreadContextSnapshot
impl PartialEq for ThreadContextSnapshot
Source§fn eq(&self, other: &ThreadContextSnapshot) -> bool
fn eq(&self, other: &ThreadContextSnapshot) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ThreadContextSnapshot
impl Serialize for ThreadContextSnapshot
impl StructuralPartialEq for ThreadContextSnapshot
Auto Trait Implementations§
impl Freeze for ThreadContextSnapshot
impl RefUnwindSafe for ThreadContextSnapshot
impl Send for ThreadContextSnapshot
impl Sync for ThreadContextSnapshot
impl Unpin for ThreadContextSnapshot
impl UnsafeUnpin for ThreadContextSnapshot
impl UnwindSafe for ThreadContextSnapshot
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