pub struct ToolResult {
pub success: bool,
pub output: String,
pub metadata: HashMap<String, Value>,
pub execution_time_ms: u64,
pub resource_usage: Option<ResourceUsage>,
}Expand description
Tool execution result with comprehensive metadata
Fields§
§success: boolWhether the tool executed successfully
output: StringTool output content
metadata: HashMap<String, Value>Execution metadata
execution_time_ms: u64Execution time in milliseconds
resource_usage: Option<ResourceUsage>Resource usage information
Implementations§
Source§impl ToolResult
impl ToolResult
Sourcepub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
pub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
Add metadata using builder pattern
Sourcepub fn with_timing(self, execution_time_ms: u64) -> Self
pub fn with_timing(self, execution_time_ms: u64) -> Self
Set execution timing
Sourcepub fn with_resource_usage(self, usage: ResourceUsage) -> Self
pub fn with_resource_usage(self, usage: ResourceUsage) -> Self
Set resource usage
Trait Implementations§
Source§impl Clone for ToolResult
impl Clone for ToolResult
Source§fn clone(&self) -> ToolResult
fn clone(&self) -> ToolResult
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 moreSource§impl Debug for ToolResult
impl Debug for ToolResult
Source§impl<'de> Deserialize<'de> for ToolResult
impl<'de> Deserialize<'de> for ToolResult
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
Auto Trait Implementations§
impl Freeze for ToolResult
impl RefUnwindSafe for ToolResult
impl Send for ToolResult
impl Sync for ToolResult
impl Unpin for ToolResult
impl UnwindSafe for ToolResult
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