pub struct Response {
pub jsonrpc: String,
pub id: RequestId,
pub result: Option<Value>,
pub error: Option<ResponseError>,
}
Expand description
Base JSON-RPC response structure
This struct represents a JSON-RPC response in the MCP protocol. It includes the JSON-RPC version, the id of the request it’s responding to, and either a result or an error field.
Fields§
§jsonrpc: String
JSON-RPC version (always “2.0”)
id: RequestId
ID of the request this response corresponds to
result: Option<Value>
The result of a successful request (null if there was an error)
error: Option<ResponseError>
The error object if the request failed (null if the request was successful)
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
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