pub struct Response<T = Value, E = Value> {
pub result: Result<T, Error<E>>,
pub id: Id,
}Expand description
A JSON-RPC 2.0 response object.
Note that the "jsonrpc": "2.0" member is transparently checked during
deserialization, and added during serialization.
Fields§
§result: Result<T, Error<E>>“result”:
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”:
This member is REQUIRED on error. This member MUST NOT exist if there was no error triggered during invocation.
id: IdThis member is REQUIRED. It MUST be the same as the value of the id member in the Request Object. If there was an error in detecting the id in the Request object (e.g. Parse error/Invalid Request), it MUST be Null.
Trait Implementations§
Source§impl<'de, T, E> Deserialize<'de> for Response<T, E>where
T: Deserialize<'de>,
E: Deserialize<'de>,
impl<'de, T, E> Deserialize<'de> for Response<T, E>where
T: Deserialize<'de>,
E: Deserialize<'de>,
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Response<T, E>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Response<T, E>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T, E> Serialize for Response<T, E>
impl<T, E> Serialize for Response<T, E>
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T, E> Eq for Response<T, E>
impl<T, E> StructuralPartialEq for Response<T, E>
Auto Trait Implementations§
impl<T, E> Freeze for Response<T, E>
impl<T, E> RefUnwindSafe for Response<T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<T, E> Send for Response<T, E>
impl<T, E> Sync for Response<T, E>
impl<T, E> Unpin for Response<T, E>
impl<T, E> UnwindSafe for Response<T, E>where
T: UnwindSafe,
E: UnwindSafe,
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