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
)