pub struct CsvReader { /* private fields */ }Implementations§
Source§impl CsvReader
impl CsvReader
Sourcepub fn new<P: AsRef<Path>>(
path: P,
delimiter: char,
has_header: bool,
) -> Result<Self>
pub fn new<P: AsRef<Path>>( path: P, delimiter: char, has_header: bool, ) -> Result<Self>
Create a new CSV reader with specified delimiter Automatically uses memory-mapped I/O for files larger than 10MB
Sourcepub fn with_columns<P: AsRef<Path>>(
path: P,
delimiter: char,
columns: Vec<String>,
) -> Result<Self>
pub fn with_columns<P: AsRef<Path>>( path: P, delimiter: char, columns: Vec<String>, ) -> Result<Self>
Create a CSV reader with explicit column names (no header in file)
Sourcepub fn column_names(&self) -> &[String]
pub fn column_names(&self) -> &[String]
Get the column names
Sourcepub fn line_number(&self) -> usize
pub fn line_number(&self) -> usize
Get current line number
Auto Trait Implementations§
impl Freeze for CsvReader
impl RefUnwindSafe for CsvReader
impl Send for CsvReader
impl Sync for CsvReader
impl Unpin for CsvReader
impl UnwindSafe for CsvReader
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
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