pub struct Response {
pub jsonrpc: &'static str,
pub id: Option<Value>,
pub result: Option<Value>,
pub error: Option<ResponseError>,
}Expand description
JSON-RPC 2.0 response envelope.
Constructed via Response::ok or Response::err; direct
field access is public so downstream code can inspect and log
responses without going through the constructors.
Fields§
§jsonrpc: &'static strJSON-RPC version marker. Always the literal "2.0".
id: Option<Value>Correlation identifier echoed back from the paired
Request. None for responses to notifications.
result: Option<Value>Success payload. Mutually exclusive with Self::error.
error: Option<ResponseError>Error payload. Mutually exclusive with Self::result.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin 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