pub struct CsvWriter { /* private fields */ }Expand description
CSV writer that builds the output in memory.
A typical admin export fits in memory. For very large ones, write in batches and flush each batch yourself.
Implementations§
Source§impl CsvWriter
impl CsvWriter
Sourcepub fn headers<I, S>(&mut self, headers: I)
pub fn headers<I, S>(&mut self, headers: I)
Write the header row. This fixes the column count: later rows are padded or truncated to match.
Sourcepub fn row<I, S>(&mut self, row: I)
pub fn row<I, S>(&mut self, row: I)
Write a data row. After headers(), the row is padded with empty
strings or cut down to the column count.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Take the buffered output.
Sourcepub fn raw_formulas(self) -> Self
pub fn raw_formulas(self) -> Self
Write values byte for byte, skipping formula neutralisation.
Use this only for CSV read by a machine. If a person may open the
file in Excel, LibreOffice or Sheets, keep the default: see
neutralize_formula.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CsvWriter
impl RefUnwindSafe for CsvWriter
impl Send for CsvWriter
impl Sync for CsvWriter
impl Unpin for CsvWriter
impl UnsafeUnpin for CsvWriter
impl UnwindSafe for CsvWriter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more