ToJson

Trait ToJson 

Source
pub trait ToJson
where Self: TypeInfo + Serialize,
{ // Provided methods fn to_json_writer<W>( &self, writer: W, compact: bool, ) -> Result<(), StamError> where W: Write { ... } fn to_json_file( &self, filename: &str, config: &Config, ) -> Result<(), StamError> { ... } fn to_json_string(&self, config: &Config) -> Result<String, StamError> { ... } fn to_json_value(&self) -> Result<Value, StamError> { ... } }

Provided Methods§

Source

fn to_json_writer<W>(&self, writer: W, compact: bool) -> Result<(), StamError>
where W: Write,

Writes a serialisation (choose a dataformat) to any writer Lower-level function

Source

fn to_json_file(&self, filename: &str, config: &Config) -> Result<(), StamError>

Writes this structure to a file The actual dataformat can be set via config, the default is STAM JSON.

Source

fn to_json_string(&self, config: &Config) -> Result<String, StamError>

Serializes this structure to one string. The actual dataformat can be set via config, the default is STAM JSON. If config not not specified, an attempt to fetch the AnnotationStore’s initial config is made

Source

fn to_json_value(&self) -> Result<Value, StamError>

Serializes this structure to a JSON value If config not not specified, an attempt to fetch the AnnotationStore’s initial config is made

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§