pub struct JsonRpcResponse {
pub jsonrpc: String,
pub result: Option<Value>,
pub error: Option<JsonRpcError>,
pub id: Value,
}Expand description
JSON-RPC 2.0 Response
Represents a JSON-RPC 2.0 response message. Either result or error will be present,
but not both.
§Success Response
When the request succeeds, result contains the response data and error is None.
§Error Response
When the request fails, error contains error details and result is None.
§Fields
jsonrpc: Version string, always"2.0"result: Success data (tool result or handler response)error: Error details if request failedid: Request ID from the original request (for correlation)
Fields§
§jsonrpc: String§result: Option<Value>§error: Option<JsonRpcError>§id: ValueImplementations§
Trait Implementations§
Source§impl Debug for JsonRpcResponse
impl Debug for JsonRpcResponse
Auto Trait Implementations§
impl Freeze for JsonRpcResponse
impl RefUnwindSafe for JsonRpcResponse
impl Send for JsonRpcResponse
impl Sync for JsonRpcResponse
impl Unpin for JsonRpcResponse
impl UnwindSafe for JsonRpcResponse
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