pub enum ParseMessageError {
BatchUnsupported,
Json(Error),
}Expand description
Error returned by parse_message_typed for the cases the untagged
JsonRpcMessage enum can’t distinguish on its own.
JsonRpcMessage is #[serde(untagged)] over Request/Response/Notification.
A top-level JSON array (a JSON-RPC §7 batch) fails serde’s variant
match with a generic “data did not match any variant” diagnostic;
MCP 2025-11-25 deprecates batches, so callers want to respond with a
clear -32600 Invalid Request rather than echoing serde’s text.
Variants§
BatchUnsupported
Top-level JSON array (deprecated batch shape).
Json(Error)
Anything else (parse error, unknown variant, etc.).
Trait Implementations§
Source§impl Debug for ParseMessageError
impl Debug for ParseMessageError
Source§impl Display for ParseMessageError
impl Display for ParseMessageError
Source§impl Error for ParseMessageError
impl Error for ParseMessageError
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 !RefUnwindSafe for ParseMessageError
impl !UnwindSafe for ParseMessageError
impl Freeze for ParseMessageError
impl Send for ParseMessageError
impl Sync for ParseMessageError
impl Unpin for ParseMessageError
impl UnsafeUnpin for ParseMessageError
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