pub struct CsvEncoder<W: Write> { /* private fields */ }Implementations§
Source§impl<W: Write> CsvEncoder<W>
impl<W: Write> CsvEncoder<W>
pub fn new(writer: W) -> Self
Sourcepub fn with_typed_headers(self, headers: Vec<String>) -> Self
pub fn with_typed_headers(self, headers: Vec<String>) -> Self
Pre-declare typed headers (one per column, in order). When set,
Self::begin uses these directly and ignores columns.
pub fn into_inner(self) -> W
Trait Implementations§
Source§impl<W: Write> RowEncoder for CsvEncoder<W>
impl<W: Write> RowEncoder for CsvEncoder<W>
Source§fn begin(&mut self, columns: &[String]) -> Result<()>
fn begin(&mut self, columns: &[String]) -> Result<()>
Emit any header bytes the format needs (CSV header row,
opening
[ for the JSON array). Must be called exactly once
before any write_row.Source§fn write_row(&mut self, row: &Row) -> Result<()>
fn write_row(&mut self, row: &Row) -> Result<()>
Write one row. The encoder pulls column names from the row’s
Row::iter_named iterator — they must align with the
columns passed to Self::begin, in the same order, for CSV.Source§fn write_named_row(&mut self, columns: &[(String, LoraValue)]) -> Result<()>
fn write_named_row(&mut self, columns: &[(String, LoraValue)]) -> Result<()>
Write the same shape as
Self::write_row from a flat
(name, value) slice. Used by encoders that consume rows
from outside the engine (testing, replay).Auto Trait Implementations§
impl<W> Freeze for CsvEncoder<W>where
W: Freeze,
impl<W> RefUnwindSafe for CsvEncoder<W>where
W: RefUnwindSafe,
impl<W> Send for CsvEncoder<W>where
W: Send,
impl<W> Sync for CsvEncoder<W>where
W: Sync,
impl<W> Unpin for CsvEncoder<W>where
W: Unpin,
impl<W> UnsafeUnpin for CsvEncoder<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for CsvEncoder<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more