Skip to main content

CsvRenderer

Struct CsvRenderer 

Source
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>

Source

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.

Source

pub fn options(&self) -> &CsvOptions

Source

pub fn rows(&self) -> u64

Rows written so far.

Source

pub fn is_done(&self) -> bool

Whether End has been rendered.

Source

pub fn into_inner(self) -> O

Trait Implementations§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.