#[non_exhaustive]pub struct ToolResult {
pub content: ToolResultContent,
pub is_error: bool,
pub structured_content: Option<Value>,
pub mcp_meta: Option<McpMeta>,
pub new_messages: Option<Vec<Value>>,
pub file_changes: Vec<FileChange>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.content: ToolResultContent§is_error: bool§structured_content: Option<Value>§mcp_meta: Option<McpMeta>§new_messages: Option<Vec<Value>>§file_changes: Vec<FileChange>The files this call wrote, for the host; the model never sees it.
Implementations§
Source§impl ToolResult
impl ToolResult
pub fn text(s: impl Into<String>) -> Self
pub fn error_text(s: impl Into<String>) -> Self
pub fn blocks(blocks: Vec<ToolResultBlock>) -> Self
pub fn with_error(self, is_error: bool) -> Self
pub fn with_structured(self, v: Value) -> Self
pub fn with_mcp_meta(self, m: McpMeta) -> Self
pub fn with_new_messages(self, m: Vec<Value>) -> Self
pub fn with_file_change(self, change: FileChange) -> Self
Trait Implementations§
Source§impl Clone for ToolResult
impl Clone for ToolResult
Source§impl Debug for ToolResult
impl Debug for ToolResult
Source§impl Default for ToolResult
impl Default 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 Forget for ToolResult
impl Freeze for ToolResult
impl Move for ToolResult
impl RefUnwindSafe for ToolResult
impl Send for ToolResult
impl Sync for ToolResult
impl Unpin for ToolResult
impl UnsafeUnpin 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