pub struct CallToolError(pub Box<dyn Error>);Expand description
A specific error type that can hold any kind of error and is used to
encapsulate various error scenarios when a CallToolRequest fails.
Tuple Fields§
§0: Box<dyn Error>Implementations§
Source§impl CallToolError
impl CallToolError
Sourcepub fn new<E>(err: E) -> CallToolErrorwhere
E: Error + 'static,
pub fn new<E>(err: E) -> CallToolErrorwhere
E: Error + 'static,
Constructor to create a new CallToolError from a generic error.
Sourcepub fn unknown_tool(tool_name: String) -> CallToolError
pub fn unknown_tool(tool_name: String) -> CallToolError
Specific constructor to create a CallToolError for an UnknownTool error.
Trait Implementations§
Source§impl Debug for CallToolError
impl Debug for CallToolError
Source§impl Display for CallToolError
impl Display for CallToolError
Source§impl Error for CallToolError
impl Error for CallToolError
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()
Source§impl From<CallToolError> for CallToolResult
Conversion of CallToolError into a CallToolResult with an error.
impl From<CallToolError> for CallToolResult
Conversion of CallToolError into a CallToolResult with an error.
Source§fn from(value: CallToolError) -> CallToolResult
fn from(value: CallToolError) -> CallToolResult
Converts to this type from the input type.
Source§impl From<CallToolError> for RpcError
Converts a CallToolError into a RpcError.
impl From<CallToolError> for RpcError
Converts a CallToolError into a RpcError.
The conversion creates an internal error variant of RpcError
and attaches the string representation of the original CallToolError as a message.
Source§fn from(value: CallToolError) -> RpcError
fn from(value: CallToolError) -> RpcError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CallToolError
impl !RefUnwindSafe for CallToolError
impl !Send for CallToolError
impl !Sync for CallToolError
impl Unpin for CallToolError
impl !UnwindSafe for CallToolError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.