CsvDataset

Struct CsvDataset 

Source
pub struct CsvDataset<'a> {
    pub names: Vec<ColName>,
    pub values: Vec<Vec<CsvAny>>,
    pub null_values: NullValues<'a>,
    pub info: Vec<ColumnInfo>,
}
Expand description

This is a form to represent the dataset which does not deep typization but can still be usefull, also info field holds some info about the types for each column

Fields§

§names: Vec<ColName>§values: Vec<Vec<CsvAny>>§null_values: NullValues<'a>§info: Vec<ColumnInfo>

Implementations§

Source§

impl<'a> CsvDataset<'a>

Source

pub fn push(&mut self, col_name: &str, col_values: Vec<CsvAny>)

Lenght of column values are not checked, so every column can have different lenght, be aware of row indexing

Source

pub fn new<R: Read>(reader: Reader<R>, null_values: NullValues<'a>) -> Self

Source

pub fn view_names_and_values(&self) -> ValueNamesView<'_>

Source

pub fn split_view_and_info( &mut self, ) -> (ValueNamesView<'_>, &mut Vec<ColumnInfo>)

Source

pub fn populate_column_infos(dataset: &mut Self)

Analyze every cell in the csv file to extract every unique value

Trait Implementations§

Source§

impl<'a> Debug for CsvDataset<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for CsvDataset<'a>

Source§

fn default() -> CsvDataset<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for CsvDataset<'a>

§

impl<'a> RefUnwindSafe for CsvDataset<'a>

§

impl<'a> Send for CsvDataset<'a>

§

impl<'a> Sync for CsvDataset<'a>

§

impl<'a> Unpin for CsvDataset<'a>

§

impl<'a> UnwindSafe for CsvDataset<'a>

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 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.