Expand description
Shallow JSON-RPC 2.0 envelope.
JsonRpcEnvelope::parse extracts jsonrpc, id, method,
params, result, error in one pass. params and result stay
as RawValue — unparsed bytes — until a caller opts in to a typed
view via JsonRpcEnvelope::params_as or
JsonRpcEnvelope::result_as.
JsonRpcEnvelope::to_bytes is the inverse — reassemble the
envelope into JSON bytes, typically before forwarding.
MCP 2025-11-25 does not batch, so parse rejects top-level JSON
arrays with ParseError::InvalidShape.
Structs§
- Json
RpcEnvelope - Shallow parse of a single JSON-RPC 2.0 message.
- Json
RpcError - JSON-RPC error object.
datastays as raw bytes so middlewares pay no cost when they don’t inspect it.
Enums§
- Json
RpcId - JSON-RPC id.
Nullis valid per spec for replies to un-parseable requests. Absent id (request-without-id, i.e. a notification) isNoneon the envelope’sidfield. - Parse
Error - Reason
JsonRpcEnvelope::parsedeclined the bytes. These are soft signals for the intake layer — aNotJsonbody is not an error to the proxy, just a hint to try the next classification branch.