pub struct EditStats {
pub added: u64,
pub removed: u64,
pub approximate: bool,
}Expand description
Cumulative line counts from the session’s file-mutating tool results.
Fields§
§added: u64§removed: u64§approximate: boolTrue when a block-level count (edit, write) is included or a
counted result had lost its trailer (truncated, spilled, failed).
Implementations§
Source§impl EditStats
impl EditStats
pub fn is_empty(&self) -> bool
Sourcepub fn record(&mut self, tool: &str, content: &str)
pub fn record(&mut self, tool: &str, content: &str)
Fold one tool result in. Tools without a trailer contract are ignored; a counted tool whose result lost its trailer marks the total approximate instead of silently undercounting.
Sourcepub fn from_messages(messages: &[Message]) -> Self
pub fn from_messages(messages: &[Message]) -> Self
Rebuild the counts from a persisted transcript: every assistant tool call to a counted tool, paired with its result by call id.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EditStats
impl<'de> Deserialize<'de> for EditStats
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
impl Eq for EditStats
impl StructuralPartialEq for EditStats
Auto Trait Implementations§
impl Freeze for EditStats
impl RefUnwindSafe for EditStats
impl Send for EditStats
impl Sync for EditStats
impl Unpin for EditStats
impl UnsafeUnpin for EditStats
impl UnwindSafe for EditStats
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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