pub enum Id {
Number(i64),
String(String),
Null,
}
Expand description
A unique ID used to correlate requests and responses together.
Variants§
Number(i64)
Numeric ID.
String(String)
String ID.
Null
Null ID.
While null
is considered a valid request ID by the JSON-RPC 2.0 specification, its use is
strongly discouraged because the specification also uses a null
value to indicate an
unknown ID in the Response
object.
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 From<NumberOrString> for Id
impl From<NumberOrString> for Id
source§fn from(num_or_str: NumberOrString) -> Self
fn from(num_or_str: NumberOrString) -> Self
Converts to this type from the input type.