pub enum McpError {
Io(Error),
Json(Error),
Handler(Box<dyn Error + Send + Sync>),
}Expand description
The primary error type for all fallible operations in the mcp-rust-sdk.
Variants§
Io(Error)
An error occurred during I/O operations (e.g., reading from stdin or writing to stdout).
Json(Error)
An error occurred during JSON serialization or deserialization.
Handler(Box<dyn Error + Send + Sync>)
An error returned by the user-provided handler function.
We wrap it in a Box to allow for any error type that implements std::error::Error.
Trait Implementations§
Source§impl Error for McpError
impl Error for McpError
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 McpError
impl !RefUnwindSafe for McpError
impl Send for McpError
impl Sync for McpError
impl Unpin for McpError
impl !UnwindSafe for McpError
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