pub struct Response {
pub jsonrpc: String,
pub result: Option<Value>,
pub error: Option<Error>,
pub id: Option<RequestId>,
pub correlation_id: Option<String>,
}Expand description
JSON-RPC 2.0 response message
Fields§
§jsonrpc: String§result: Option<Value>§error: Option<Error>§id: Option<RequestId>§correlation_id: Option<String>Implementations§
Source§impl Response
impl Response
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if this is a successful response
Sourcepub fn take_result(self) -> Option<Value>
pub fn take_result(self) -> Option<Value>
Take ownership of the result
Sourcepub fn error_info(&self) -> Option<&Error>
pub fn error_info(&self) -> Option<&Error>
Get error information
Sourcepub fn take_error(self) -> Option<Error>
pub fn take_error(self) -> Option<Error>
Take ownership of the error
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
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
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