Trait identity_iota::core::ToJson
source · [−]pub trait ToJson: Serialize {
fn to_json(&self) -> Result<String, Error> { ... }
fn to_json_vec(&self) -> Result<Vec<u8, Global>, Error> { ... }
fn to_json_value(&self) -> Result<Value, Error> { ... }
fn to_json_pretty(&self) -> Result<String, Error> { ... }
fn to_jcs(&self) -> Result<Vec<u8, Global>, Error> { ... }
}
Expand description
A convenience-trait for types that can be serialized as JSON.
Provided Methods
fn to_json_value(&self) -> Result<Value, Error>
fn to_json_value(&self) -> Result<Value, Error>
Serialize self
as a [serde_json::Value
].
fn to_json_pretty(&self) -> Result<String, Error>
fn to_json_pretty(&self) -> Result<String, Error>
Serialize self
as a pretty-printed string of JSON.