Struct irox_csv::CSVReader

source ·
pub struct CSVReader<T>where
    T: Read + Sized,{ /* 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>

source

pub fn new(reader: T) -> CSVReader<T>

Create a new CSV Reader from the input. Accepts anything that implements Read

source

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> 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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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.