Skip to main content

RowDecoder

Trait RowDecoder 

Source
pub trait RowDecoder {
    // Required methods
    fn header(&mut self) -> Result<Option<Vec<String>>, Error>;
    fn next_row(&mut self) -> Result<Option<Vec<(String, LoraValue)>>, Error>;
}
Expand description

Pull-based row decoder. Reads from a std::io::BufRead and yields completed rows one at a time. Used by native Rust callers that already have the input as a stream-like reader.

Required Methods§

Source

fn header(&mut self) -> Result<Option<Vec<String>>, Error>

Returns the column names declared in the file header. CSV uses this; JSONL/JSON return None (every row carries its own keys).

Source

fn next_row(&mut self) -> Result<Option<Vec<(String, LoraValue)>>, Error>

Pull the next row as a flat (name, value) vector. Returns Ok(None) once the input is exhausted.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<R> RowDecoder for CsvDecoder<R>
where R: BufRead,

Source§

impl<R> RowDecoder for JsonArrayDecoder<R>
where R: BufRead,

Source§

impl<R> RowDecoder for JsonlDecoder<R>
where R: BufRead,