Enum alloy_json_rpc::Id
source · pub enum Id {
Number(u64),
String(String),
None,
}
Expand description
A JSON-RPC 2.0 ID object. This may be a number, a string, or null.
§Ordering
This type implements PartialOrd
, Ord
, PartialEq
, and Eq
so
that it can be used as a key in a BTreeMap
or an item in a
BTreeSet
. The ordering is as follows:
- Numbers are less than strings.
- Strings are less than null.
- Null is equal to null.
§Hash
This type implements Hash
so that it can be used as a key in a
HashMap
or an item in a HashSet
.
Variants§
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Id
impl<'de> Deserialize<'de> for Id
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 Ord for Id
impl Ord for Id
source§impl PartialOrd for Id
impl PartialOrd for Id
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 Eq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.