pub struct RequestMeta {
pub method: Cow<'static, str>,
pub id: Id,
/* private fields */
}
Expand description
RequestMeta
contains the Id
and method name of a request.
Fields§
§method: Cow<'static, str>
The method name.
id: Id
The request ID.
Implementations§
Source§impl RequestMeta
impl RequestMeta
Sourcepub fn is_subscription(&self) -> bool
pub fn is_subscription(&self) -> bool
Returns true
if the request is a subscription.
Sourcepub const fn set_is_subscription(&mut self)
pub const fn set_is_subscription(&mut self)
Indicates that the request is a non-standard subscription (i.e. not “eth_subscribe”).
Sourcepub const fn set_subscription_status(&mut self, sub: bool)
pub const fn set_subscription_status(&mut self, sub: bool)
Setter for is_subscription
. Indicates to RPC clients that the request
triggers a stream of notifications.
Sourcepub const fn extensions(&self) -> &Extensions
pub const fn extensions(&self) -> &Extensions
Returns a reference to the request extensions.
These can be used to attach additional metadata to the request that can be used by middleware or other components.
Sourcepub const fn extensions_mut(&mut self) -> &mut Extensions
pub const fn extensions_mut(&mut self) -> &mut Extensions
Returns a mutable reference to the request extensions.
These can be used to attach additional metadata to the request that can be used by middleware or other components.
Trait Implementations§
Source§impl Clone for RequestMeta
impl Clone for RequestMeta
Source§fn clone(&self) -> RequestMeta
fn clone(&self) -> RequestMeta
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RequestMeta
impl Debug for RequestMeta
Source§impl PartialEq for RequestMeta
impl PartialEq for RequestMeta
impl Eq for RequestMeta
Auto Trait Implementations§
impl Freeze for RequestMeta
impl !RefUnwindSafe for RequestMeta
impl Send for RequestMeta
impl Sync for RequestMeta
impl Unpin for RequestMeta
impl !UnwindSafe for RequestMeta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.