pub struct ToolResult {
pub output: Box<ToolCallOutput>,
pub success: bool,
pub result: Value,
}Fields§
§output: Box<ToolCallOutput>§success: bool§result: ValueImplementations§
Source§impl ToolResult
impl ToolResult
pub fn from_output(output: ToolCallOutput) -> ToolResult
pub fn ok(result: Value) -> ToolResult
pub fn err(result: Value) -> ToolResult
pub fn err_fmt(msg: impl Display) -> ToolResult
pub fn failure(failure: ToolFailure) -> ToolResult
pub fn retryable_failure( class: ToolFailureClass, code: impl Into<String>, message: impl Into<String>, after_ms: Option<u64>, ) -> ToolResult
pub fn cancelled(message: impl Into<String>) -> ToolResult
pub fn cancelled_with_raw(message: impl Into<String>, raw: Value) -> ToolResult
pub fn with_control(self, control: ToolControl) -> ToolResult
pub fn is_success(&self) -> bool
pub fn value_for_projection(&self) -> Value
pub fn into_value_for_projection(self) -> Value
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 (const: unstable) · 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<T, E> From<Result<T, E>> for ToolResult
impl<T, E> From<Result<T, E>> for ToolResult
Source§fn from(result: Result<T, E>) -> ToolResult
fn from(result: Result<T, E>) -> ToolResult
Converts to this type from the input type.
Source§impl PartialEq for ToolResult
impl PartialEq for ToolResult
Source§fn eq(&self, other: &ToolResult) -> bool
fn eq(&self, other: &ToolResult) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ToolResult
Auto Trait Implementations§
impl Freeze 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