Enum ruma_signatures::CanonicalJsonValue[][src]

pub enum CanonicalJsonValue {
    Null,
    Bool(bool),
    Integer(Int),
    String(String),
    Array(Vec<CanonicalJsonValue, Global>),
    Object(BTreeMap<String, CanonicalJsonValue>),
}

Variants

Null

Represents a JSON null value.

let v: CanonicalJsonValue = json!(null).try_into().unwrap();
Bool(bool)

Represents a JSON boolean.

let v: CanonicalJsonValue = json!(true).try_into().unwrap();
Integer(Int)

Represents a JSON integer.

let v: CanonicalJsonValue = json!(12).try_into().unwrap();
String(String)

Represents a JSON string.

let v: CanonicalJsonValue = json!("a string").try_into().unwrap();

Represents a JSON array.

let v: CanonicalJsonValue = json!(["an", "array"]).try_into().unwrap();

Represents a JSON object.

The map is backed by a BTreeMap to guarantee the sorting of keys.

let v: CanonicalJsonValue = json!({ "an": "object" }).try_into().unwrap();

Trait Implementations

impl Clone for CanonicalJsonValue[src]

impl Debug for CanonicalJsonValue[src]

impl Default for CanonicalJsonValue[src]

impl<'de> Deserialize<'de> for CanonicalJsonValue[src]

impl Display for CanonicalJsonValue[src]

pub fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>[src]

Display this value as a string.

This Display implementation is intentionally unaffected by any formatting parameters, because adding extra whitespace or otherwise pretty-printing it would make it not the canonical form anymore.

If you want to pretty-print a CanonicalJsonValue for debugging purposes, use one of serde_json::{to_string_pretty, to_vec_pretty, to_writer_pretty}.

impl Eq for CanonicalJsonValue[src]

impl PartialEq<CanonicalJsonValue> for CanonicalJsonValue[src]

impl Serialize for CanonicalJsonValue[src]

impl StructuralEq for CanonicalJsonValue[src]

impl StructuralPartialEq for CanonicalJsonValue[src]

impl TryFrom<Value> for CanonicalJsonValue[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.