pub struct CSVReader<T>{ /* private fields */ }
Expand description
Incredibly basic CSV reader.
Has some equivalent functionality as String.split(",")
, except it handles quoted entries.
Implementations§
Source§impl<T: Read + Sized> CSVReader<T>
impl<T: Read + Sized> CSVReader<T>
Sourcepub fn new(reader: T) -> CSVReader<T>
pub fn new(reader: T) -> CSVReader<T>
Create a new CSV Reader from the input. Accepts anything that implements Read
Sourcepub fn dialect(reader: T, dialect: Dialect) -> CSVReader<T>
pub fn dialect(reader: T, dialect: Dialect) -> CSVReader<T>
Creates a new CSV reader based on the specified dialect. Accepts any
Read
er and consumes it.
Sourcepub fn read_line(&mut self) -> Result<Option<Vec<String>>, CSVError>
pub fn read_line(&mut self) -> Result<Option<Vec<String>>, CSVError>
Read and parse a single line from the CSV file.
Will return [Result::Ok(None)
] upon EOF.
Will return [Result::Err(CSVError)
] upon any I/O error.
Will return [Result::Ok(Option::Some(Vec<String>))
] upon success, with each element within
the line separated inside of the innermost Vec<String>
Auto Trait Implementations§
impl<T> Freeze for CSVReader<T>where
T: Freeze,
impl<T> RefUnwindSafe for CSVReader<T>where
T: RefUnwindSafe,
impl<T> Send for CSVReader<T>where
T: Send,
impl<T> Sync for CSVReader<T>where
T: Sync,
impl<T> Unpin for CSVReader<T>where
T: Unpin,
impl<T> UnwindSafe for CSVReader<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