pub enum Response {
Ok {
id: String,
result: Value,
},
Error {
id: String,
error: String,
},
}Expand description
A JSON-RPC response to the client.
Responses are tagged with a status field that indicates success or failure.
§Variants
Ok- Successful response with a result valueError- Error response with an error message
§Example JSON (Success)
{
"status": "ok",
"id": "req-123",
"result": 15
}§Example JSON (Error)
{
"status": "error",
"id": "req-123",
"error": "Invalid parameters"
}Variants§
Trait Implementations§
impl StructuralPartialEq for Response
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