pub struct CsvRenderer<O: TextOut> { /* private fields */ }Expand description
Renders TableRows/1 as CSV.
One schema first, rows exactly as wide as the schema, one end: anything
else is PROTOCOL_ORDER_ERROR. A schema with no columns has no CSV form
(a record cannot be empty) and is TARGET_VALUE_UNREPRESENTABLE. Every
record, the header included, ends with the configured newline, the last
one too. The output is flushed once, at End, so a table that fails
half way is not flushed as if it were whole; a failure found after any
text was written says so with committed_output.
Implementations§
Source§impl<O: TextOut> CsvRenderer<O>
impl<O: TextOut> CsvRenderer<O>
Sourcepub fn new(out: O, options: CsvOptions) -> Result<Self, Fail>
pub fn new(out: O, options: CsvOptions) -> Result<Self, Fail>
A renderer over out, or TARGET_VALUE_UNREPRESENTABLE when the
delimiter is one no CSV reader could take.
pub fn options(&self) -> &CsvOptions
pub fn into_inner(self) -> O
Trait Implementations§
Source§impl<O: TextOut> TableSink for CsvRenderer<O>
impl<O: TextOut> TableSink for CsvRenderer<O>
fn table_event(&mut self, ev: TableEvent<'_>) -> Result<Flow, Fail>
Auto Trait Implementations§
impl<O> Freeze for CsvRenderer<O>where
O: Freeze,
impl<O> RefUnwindSafe for CsvRenderer<O>where
O: RefUnwindSafe,
impl<O> Send for CsvRenderer<O>where
O: Send,
impl<O> Sync for CsvRenderer<O>where
O: Sync,
impl<O> Unpin for CsvRenderer<O>where
O: Unpin,
impl<O> UnsafeUnpin for CsvRenderer<O>where
O: UnsafeUnpin,
impl<O> UnwindSafe for CsvRenderer<O>where
O: 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