pub struct InMemoryCsvReader { /* private fields */ }Expand description
In-memory CSV reader that parses a complete CSV string.
Supports:
- configurable delimiter
- comment lines starting with
# - empty fields (treated as
f64::NAN) - quoted strings (double-quoted fields with escaped commas)
Implementations§
Source§impl InMemoryCsvReader
impl InMemoryCsvReader
Sourcepub fn from_str(data: &str) -> Result<Self, Error>
pub fn from_str(data: &str) -> Result<Self, Error>
Parse a CSV string with the default comma delimiter.
Sourcepub fn parse_with_delimiter(data: &str, delim: char) -> Result<Self, Error>
pub fn parse_with_delimiter(data: &str, delim: char) -> Result<Self, Error>
Parse a CSV string with a custom delimiter.
Sourcepub fn get_column_f64(&self, name: &str) -> Result<Vec<f64>, Error>
pub fn get_column_f64(&self, name: &str) -> Result<Vec<f64>, Error>
Return the values in the named column as f64.
Missing (None) values are replaced with f64::NAN.
Sourcepub fn get_row_count(&self) -> usize
pub fn get_row_count(&self) -> usize
Return the number of data rows (excluding header).
Auto Trait Implementations§
impl Freeze for InMemoryCsvReader
impl RefUnwindSafe for InMemoryCsvReader
impl Send for InMemoryCsvReader
impl Sync for InMemoryCsvReader
impl Unpin for InMemoryCsvReader
impl UnsafeUnpin for InMemoryCsvReader
impl UnwindSafe for InMemoryCsvReader
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.