Trait stam::ToJson

source ·
pub trait ToJsonwhere
    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> { ... }
}

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

Implementors§