Skip to main content

FormatReader

Trait FormatReader 

Source
pub trait FormatReader {
    // Required methods
    fn read(&self, input: &str) -> Result<Value>;
    fn read_from_reader(&self, reader: impl Read) -> Result<Value>;
}
Expand description

Trait for reading a data format into a Value.

Implement this trait to add support for reading a new data format.

Required Methods§

Source

fn read(&self, input: &str) -> Result<Value>

Parse the given string content and return a Value.

Source

fn read_from_reader(&self, reader: impl Read) -> Result<Value>

Parse data from an io::Read source and return a Value.

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§