pub struct CSVWriter<T>where
T: Write + Sized,{ /* private fields */ }
Expand description
Flexible CSV writer, wherein one can specify
Implementations§
source§impl<T: Write + Sized> CSVWriter<T>
impl<T: Write + Sized> CSVWriter<T>
sourcepub fn write_header(&mut self) -> Result<(), CSVError>
pub fn write_header(&mut self) -> Result<(), CSVError>
Ensures that the header (if specified and present) is written to the file.
sourcepub fn write_line<R: AsRef<str>>(
&mut self,
fields: &[R]
) -> Result<(), CSVError>
pub fn write_line<R: AsRef<str>>( &mut self, fields: &[R] ) -> Result<(), CSVError>
Raw low-level write of a set of fields to this file in simple iteration order. This does NOT check against previous lines to ensure the fields are the same length as priors.
sourcepub fn write_fields(
&mut self,
fields: &BTreeMap<String, String>
) -> Result<(), CSVError>
pub fn write_fields( &mut self, fields: &BTreeMap<String, String> ) -> Result<(), CSVError>
Write the set of fields to the CSV file. You must have already provided a set of headers/columns
or else this function will fail with a CSVErrorType::MissingHeaderError
.
It will write the fields in the order defined by the columns.
Note: It is NOT required for the fields map to have every header/column within it. Any missing fields will be replaced with an empty string.
Auto Trait Implementations§
impl<T> RefUnwindSafe for CSVWriter<T>where T: RefUnwindSafe,
impl<T> Send for CSVWriter<T>where T: Send,
impl<T> Sync for CSVWriter<T>where T: Sync,
impl<T> Unpin for CSVWriter<T>where T: Unpin,
impl<T> UnwindSafe for CSVWriter<T>where T: 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