pub trait CanonJsonSerialize {
// Required methods
fn to_canon_json_writer<W>(&self, writer: W) -> Result<()>
where W: Write;
fn to_canon_json_vec(&self) -> Result<Vec<u8>>;
fn to_canon_json_string(&self) -> Result<String>;
}Expand description
A helper trait to write canonical JSON.
Required Methods§
Sourcefn to_canon_json_writer<W>(&self, writer: W) -> Result<()>where
W: Write,
fn to_canon_json_writer<W>(&self, writer: W) -> Result<()>where
W: Write,
Serialize the given data structure as JSON into the I/O stream.
Sourcefn to_canon_json_vec(&self) -> Result<Vec<u8>>
fn to_canon_json_vec(&self) -> Result<Vec<u8>>
Serialize the given data structure as a JSON byte vector.
Sourcefn to_canon_json_string(&self) -> Result<String>
fn to_canon_json_string(&self) -> Result<String>
Serialize the given data structure as a String.
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.