[][src]Trait serde_json::value::ToJson

pub trait ToJson {
    fn to_json(&self) -> Result<Value, Error>;
}

Representation of any serializable data as a serde_json::Value.

Required methods

fn to_json(&self) -> Result<Value, Error>

Represent self as a serde_json::Value. Note that Value is not a JSON string. If you need a string, use serde_json::to_string instead.

This conversion can fail if T's implementation of Serialize decides to fail, or if T contains a map with non-string keys.

Loading content...

Implementors

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

Loading content...