pub enum ToolError {
InvalidInput(String),
Internal(String),
External(String),
Permission(String),
NotFound(String),
}Expand description
Error type returned by tool operations.
Variants§
InvalidInput(String)
Invalid input provided to the tool.
Internal(String)
Internal error during tool execution.
External(String)
Error from an external service.
Permission(String)
Permission denied for the operation.
NotFound(String)
Requested resource not found.
Implementations§
Source§impl ToolError
impl ToolError
Sourcepub fn invalid_input<S: ToString>(s: S) -> Self
pub fn invalid_input<S: ToString>(s: S) -> Self
Create an invalid input error.
Sourcepub fn permission<S: ToString>(s: S) -> Self
pub fn permission<S: ToString>(s: S) -> Self
Create a permission denied error.
Trait Implementations§
Source§impl Error for ToolError
impl Error for ToolError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ToolError
impl RefUnwindSafe for ToolError
impl Send for ToolError
impl Sync for ToolError
impl Unpin for ToolError
impl UnwindSafe for ToolError
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