pub struct ToolRunMetadata {
pub detail: ToolMetadata,
pub line_count: Option<usize>,
pub byte_count: Option<usize>,
pub result_count: Option<usize>,
pub duration_secs: Option<f64>,
pub process: Option<ManagedProcess>,
pub display_diff: Option<String>,
pub diff_truncated: bool,
pub lines_added: usize,
pub lines_removed: usize,
pub artifacts: Vec<ToolArtifact>,
pub token_usage: Option<TokenUsage>,
}Expand description
Structured metadata extracted from a completed tool run.
Fields§
§detail: ToolMetadata§line_count: Option<usize>§byte_count: Option<usize>§result_count: Option<usize>§duration_secs: Option<f64>§process: Option<ManagedProcess>§display_diff: Option<String>User-facing display diff for file mutations. This is captured at tool execution time so whole-file writes can compare against the pre-write contents even after the file has been overwritten.
diff_truncated: bool§lines_added: usizeExact line-change counts for file mutations. Carried separately from
display_diff because that string is capped at
MAX_DISPLAY_DIFF_LINES — recounting it would undercount large
writes. handle_tool_finished folds these into the per-run totals
behind the end-of-run +N/-M summary.
lines_removed: usize§artifacts: Vec<ToolArtifact>§token_usage: Option<TokenUsage>Provider token usage the tool itself consumed (today: a subagent’s
cumulative child-session usage). handle_tool_finished folds it into
the parent session’s totals so the footer and the end-of-run summary
count the whole tree, not just the parent’s own model calls.
Trait Implementations§
Source§impl Clone for ToolRunMetadata
impl Clone for ToolRunMetadata
Source§fn clone(&self) -> ToolRunMetadata
fn clone(&self) -> ToolRunMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolRunMetadata
impl Debug for ToolRunMetadata
Source§impl Default for ToolRunMetadata
impl Default for ToolRunMetadata
Source§fn default() -> ToolRunMetadata
fn default() -> ToolRunMetadata
Source§impl<'de> Deserialize<'de> for ToolRunMetadata
impl<'de> Deserialize<'de> for ToolRunMetadata
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>,
Source§impl PartialEq for ToolRunMetadata
impl PartialEq for ToolRunMetadata
Source§impl Serialize for ToolRunMetadata
impl Serialize for ToolRunMetadata
impl StructuralPartialEq for ToolRunMetadata
Auto Trait Implementations§
impl Freeze for ToolRunMetadata
impl RefUnwindSafe for ToolRunMetadata
impl Send for ToolRunMetadata
impl Sync for ToolRunMetadata
impl Unpin for ToolRunMetadata
impl UnsafeUnpin for ToolRunMetadata
impl UnwindSafe for ToolRunMetadata
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
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>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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