pub struct RawResponse<'a>(/* private fields */);
Available on crate feature
client
only.Expand description
A raw JSON-RPC response object which can be either a JSON-RPC success or error response.
This is a wrapper around the jsonrpsee_types::Response
type for ease of use
for middleware client implementations.
Implementations§
Source§impl<'a> RawResponse<'a>
impl<'a> RawResponse<'a>
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Whether this response is successful JSON-RPC response.
Sourcepub fn as_error(&self) -> Option<&ErrorObject<'_>>
pub fn as_error(&self) -> Option<&ErrorObject<'_>>
Extract the error object from the response if it is an error.
Sourcepub fn as_success(&self) -> Option<&RawValue>
pub fn as_success(&self) -> Option<&RawValue>
Omits JSON-RPC specific fields like jsonrpc
and id
.
Sourcepub fn into_inner(self) -> Response<'a, Box<RawValue>>
pub fn into_inner(self) -> Response<'a, Box<RawValue>>
Consume the response and extract the inner value.
Sourcepub fn into_owned(self) -> RawResponseOwned
pub fn into_owned(self) -> RawResponseOwned
Convert the response into an owned version.
Trait Implementations§
Source§impl<'a> Debug for RawResponse<'a>
impl<'a> Debug for RawResponse<'a>
Source§impl Serialize for RawResponse<'_>
impl Serialize for RawResponse<'_>
Auto Trait Implementations§
impl<'a> Freeze for RawResponse<'a>
impl<'a> !RefUnwindSafe for RawResponse<'a>
impl<'a> Send for RawResponse<'a>
impl<'a> Sync for RawResponse<'a>
impl<'a> Unpin for RawResponse<'a>
impl<'a> !UnwindSafe for RawResponse<'a>
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