pub trait ToJson{
// 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§
Sourcefn to_json_writer<W>(&self, writer: W, compact: bool) -> Result<(), StamError>where
W: Write,
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
Sourcefn to_json_file(&self, filename: &str, config: &Config) -> Result<(), StamError>
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.
Sourcefn to_json_string(&self, config: &Config) -> Result<String, StamError>
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
Sourcefn to_json_value(&self) -> Result<Value, StamError>
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.