pub trait Writable {
// Required methods
fn encode(&self) -> String;
fn encode_pp(&self) -> String;
fn write<'writer, W>(&self, w: &mut W) -> Result<(), Error>
where W: 'writer + Write;
fn write_pp<'writer, W>(&self, w: &mut W) -> Result<(), Error>
where W: 'writer + Write;
}
Expand description
A Value that can be serialized and written
Required Methods§
Sourcefn encode_pp(&self) -> String
fn encode_pp(&self) -> String
Encodes the value into it’s JSON representation as a string (pretty printed)
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.