pub struct SerializedRequest { /* private fields */ }
Expand description
A JSON-RPC 2.0 request object that has been serialized, with its Id
and
method preserved.
This struct is used to represent a request that has been serialized, but not yet sent. It is used by RPC clients to build batch requests and manage in-flight requests.
Implementations§
Source§impl SerializedRequest
impl SerializedRequest
Sourcepub const fn meta(&self) -> &RequestMeta
pub const fn meta(&self) -> &RequestMeta
Returns the request metadata (ID and Method).
Sourcepub fn set_is_subscription(&mut self)
pub fn set_is_subscription(&mut self)
Mark the request as a non-standard subscription (i.e. not
eth_subscribe
)
Sourcepub fn is_subscription(&self) -> bool
pub fn is_subscription(&self) -> bool
Returns true
if the request is a subscription.
Sourcepub const fn serialized(&self) -> &RawValue
pub const fn serialized(&self) -> &RawValue
Returns the serialized request.
Sourcepub fn into_serialized(self) -> Box<RawValue>
pub fn into_serialized(self) -> Box<RawValue>
Consume the serialized request, returning the underlying RawValue
.
Sourcepub fn decompose(self) -> (RequestMeta, Box<RawValue>)
pub fn decompose(self) -> (RequestMeta, Box<RawValue>)
Consumes the serialized request, returning the underlying
RequestMeta
and the RawValue
.
Sourcepub fn take_request(self) -> Box<RawValue>
pub fn take_request(self) -> Box<RawValue>
Take the serialized request, consuming the SerializedRequest
.
Sourcepub fn params(&self) -> Option<&RawValue>
pub fn params(&self) -> Option<&RawValue>
Get a reference to the serialized request’s params.
This partially deserializes the request, and should be avoided if possible.
Sourcepub fn params_hash(&self) -> B256
pub fn params_hash(&self) -> B256
Get the hash of the serialized request’s params.
This partially deserializes the request, and should be avoided if possible.
Trait Implementations§
Source§impl Clone for SerializedRequest
impl Clone for SerializedRequest
Source§fn clone(&self) -> SerializedRequest
fn clone(&self) -> SerializedRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SerializedRequest
impl Debug for SerializedRequest
Source§impl From<SerializedRequest> for RequestPacket
impl From<SerializedRequest> for RequestPacket
Source§fn from(req: SerializedRequest) -> Self
fn from(req: SerializedRequest) -> Self
Source§impl FromIterator<SerializedRequest> for RequestPacket
impl FromIterator<SerializedRequest> for RequestPacket
Source§fn from_iter<T: IntoIterator<Item = SerializedRequest>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = SerializedRequest>>(iter: T) -> Self
Source§impl Serialize for SerializedRequest
impl Serialize for SerializedRequest
Auto Trait Implementations§
impl Freeze for SerializedRequest
impl RefUnwindSafe for SerializedRequest
impl Send for SerializedRequest
impl Sync for SerializedRequest
impl Unpin for SerializedRequest
impl UnwindSafe for SerializedRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)