Skip to main content

CsvLoader

Struct CsvLoader 

Source
pub struct CsvLoader { /* private fields */ }
Expand description

Parser state carried between chunks.

Implementations§

Source§

impl CsvLoader

Source

pub fn new(opts: CsvOptions) -> Result<Self, String>

Source

pub fn rows(&self) -> usize

Rows added so far.

Source

pub fn feed(&mut self, t: &mut DynTable, chunk: &[u8]) -> Result<(), String>

Parse the next chunk; rows completed in it are appended to t.

Source

pub fn finish(&mut self, t: &mut DynTable) -> Result<usize, String>

End of input: a last row without a trailing newline is added.

Source

pub fn names(&self) -> Option<&[String]>

The column names: from the header row once it has been read, or as given.

Source

pub fn starting_at_line(self, line: usize) -> Self

Number error messages from line, for a loader fed a piece of a file that starts on that line.

Auto Trait Implementations§

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.