pub struct ValueSnapshot {Show 13 fields
pub schema: u32,
pub session_id: String,
pub project_root: Option<String>,
pub started_at: Option<DateTime<Utc>>,
pub updated_at: Option<DateTime<Utc>>,
pub tool_calls: u64,
pub tokens_input: u64,
pub tokens_saved: u64,
pub cache_hits: u64,
pub files_read: u64,
pub commands_run: u64,
pub security: SecurityCounts,
pub host_pid: Option<u32>,
}Fields§
§schema: u32§session_id: String§project_root: Option<String>§started_at: Option<DateTime<Utc>>§updated_at: Option<DateTime<Utc>>§tool_calls: u64§tokens_input: u64Tokens lean-ctx’s tools would have sent without compression.
tokens_saved: u64Tokens kept out of the model’s context (measured, per tool result).
cache_hits: u64§files_read: u64§commands_run: u64§security: SecurityCounts§host_pid: Option<u32>The agent process that started the writing MCP server (see super::host).
Implementations§
Source§impl ValueSnapshot
impl ValueSnapshot
pub fn from_session(session: &SessionState) -> Self
Sourcepub fn saved_pct(&self) -> Option<f64>
pub fn saved_pct(&self) -> Option<f64>
Share of tool input kept out of context, in percent (derived).
Trait Implementations§
Source§impl Clone for ValueSnapshot
impl Clone for ValueSnapshot
Source§impl Debug for ValueSnapshot
impl Debug for ValueSnapshot
Source§impl Default for ValueSnapshot
impl Default for ValueSnapshot
Source§impl<'de> Deserialize<'de> for ValueSnapshotwhere
ValueSnapshot: Default,
impl<'de> Deserialize<'de> for ValueSnapshotwhere
ValueSnapshot: Default,
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 ValueSnapshot
impl PartialEq for ValueSnapshot
Source§impl Serialize for ValueSnapshot
impl Serialize for ValueSnapshot
impl StructuralPartialEq for ValueSnapshot
Auto Trait Implementations§
impl Forget for ValueSnapshot
impl Freeze for ValueSnapshot
impl Move for ValueSnapshot
impl RefUnwindSafe for ValueSnapshot
impl Send for ValueSnapshot
impl Sync for ValueSnapshot
impl Unpin for ValueSnapshot
impl UnsafeUnpin for ValueSnapshot
impl UnwindSafe for ValueSnapshot
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>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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