ToJson

Trait ToJson 

Source
pub trait ToJson {
    // Required methods
    fn to_json_value(&self) -> Value;
    fn from_json(s: &str) -> Self;

    // Provided methods
    fn to_json(&self) -> String { ... }
    fn to_json_pretty(&self) -> String { ... }
}

Required Methods§

Source

fn to_json_value(&self) -> Value

Source

fn from_json(s: &str) -> Self

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§