Trait SerializeJson

Source
pub trait SerializeJson: Serialize {
    // Provided methods
    fn to_json_string(&self) -> Result<String, Error> { ... }
    fn to_json_string_pretty(&self) -> Result<String, Error> { ... }
    fn to_json_vec(&self) -> Result<Vec<u8>, Error> { ... }
    fn to_json_vec_pretty(&self) -> Result<Vec<u8>, Error> { ... }
}

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§

Source§

impl<T> SerializeJson for T
where T: Serialize,