Enum jsonrpsee_types::params::Id
source · Expand description
Request Id
Variants§
Implementations§
source§impl<'a> Id<'a>
impl<'a> Id<'a>
sourcepub fn as_number(&self) -> Option<&u64>
pub fn as_number(&self) -> Option<&u64>
If the Id is a number, returns the associated number. Returns None otherwise.
sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
If the Id is a String, returns the associated str. Returns None otherwise.
sourcepub fn into_owned(self) -> Id<'static>
pub fn into_owned(self) -> Id<'static>
Convert Id<'a>
to Id<'static>
so that it can be moved across threads.
This can cause an allocation if the id is a string.
sourcepub fn try_parse_inner_as_number(&self) -> Option<u64>
pub fn try_parse_inner_as_number(&self) -> Option<u64>
Extract the underlying number from the ID.
Trait Implementations§
source§impl<'de: 'a, 'a> Deserialize<'de> for Id<'a>
impl<'de: 'a, 'a> Deserialize<'de> for Id<'a>
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
source§impl<'a> Ord for Id<'a>
impl<'a> Ord for Id<'a>
source§impl<'a> PartialOrd<Id<'a>> for Id<'a>
impl<'a> PartialOrd<Id<'a>> for Id<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'a> Eq for Id<'a>
impl<'a> StructuralEq for Id<'a>
impl<'a> StructuralPartialEq for Id<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Id<'a>
impl<'a> Send for Id<'a>
impl<'a> Sync for Id<'a>
impl<'a> Unpin for Id<'a>
impl<'a> UnwindSafe for Id<'a>
Blanket Implementations§
source§impl<T> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere
T: Hash + ?Sized,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.