pub struct ErrorContext { /* private fields */ }Expand description
Builder that attaches tool and operation context to a ToolError.
Implementations§
Source§impl ErrorContext
impl ErrorContext
Sourcepub fn with_tool(self, tool_name: impl Into<String>) -> Self
pub fn with_tool(self, tool_name: impl Into<String>) -> Self
Attach a tool name to this context.
Sourcepub fn tool_not_found(self) -> ToolError
pub fn tool_not_found(self) -> ToolError
Build a ToolError::ToolNotFound from this context.
Sourcepub fn invalid_parameters(self, message: impl Into<String>) -> ToolError
pub fn invalid_parameters(self, message: impl Into<String>) -> ToolError
Build a ToolError::InvalidParameters from this context.
Sourcepub fn execution_failed(self, message: impl Into<String>) -> ToolError
pub fn execution_failed(self, message: impl Into<String>) -> ToolError
Build a ToolError::ExecutionFailed from this context.
Sourcepub fn schema_validation(self, message: impl Into<String>) -> ToolError
pub fn schema_validation(self, message: impl Into<String>) -> ToolError
Build a ToolError::SchemaValidation from this context.
Sourcepub fn serialization_error(self, source: Error) -> ToolError
pub fn serialization_error(self, source: Error) -> ToolError
Build a ToolError::SerializationError from this context.
Sourcepub fn timeout_error(self, timeout: Duration) -> ToolError
pub fn timeout_error(self, timeout: Duration) -> ToolError
Build a ToolError::TimeoutError from this context.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ErrorContext
impl RefUnwindSafe for ErrorContext
impl Send for ErrorContext
impl Sync for ErrorContext
impl Unpin for ErrorContext
impl UnsafeUnpin for ErrorContext
impl UnwindSafe for ErrorContext
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