pub struct Response<S, R, D>{
pub id: usize,
pub jsonrpc: Version,
pub result: Option<R>,
pub error: Option<Error<S, D>>,
}
Expand description
When a rpc call is made, the Server MUST reply with a Response, except for in the case of Notifications.
visit here
for details
Fields§
§id: usize
This member is REQUIRED on error. This member MUST NOT exist if there was no error triggered during invocation.
jsonrpc: Version
A String specifying the version of the JSON-RPC protocol. MUST be exactly “2.0”.
result: Option<R>
This member is REQUIRED on success. This member MUST NOT exist if there was an error invoking the method. The value of this member is determined by the method invoked on the Server.
error: Option<Error<S, D>>
This member is REQUIRED on error. This member MUST NOT exist if there was no error triggered during invocation.
Trait Implementations§
Source§impl<'de, S, R, D> Deserialize<'de> for Response<S, R, D>
impl<'de, S, R, D> Deserialize<'de> for Response<S, R, D>
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
impl<S, R, D> StructuralPartialEq for Response<S, R, D>
Auto Trait Implementations§
impl<S, R, D> Freeze for Response<S, R, D>
impl<S, R, D> RefUnwindSafe for Response<S, R, D>
impl<S, R, D> Send for Response<S, R, D>
impl<S, R, D> Sync for Response<S, R, D>
impl<S, R, D> Unpin for Response<S, R, D>
impl<S, R, D> UnwindSafe for Response<S, R, D>
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