pub struct CsvStreamParser {
pub delimiter: char,
pub headers: Vec<String>,
pub rows: Vec<Vec<String>>,
pub has_header: bool,
pub error_count: usize,
}Expand description
A streaming CSV parser that processes data line by line.
Supports optional header rows, delimiter configuration, and type-safe extraction of f64 columns.
Fields§
§delimiter: charColumn delimiter character.
headers: Vec<String>Column headers (populated if the first row is a header).
rows: Vec<Vec<String>>Parsed rows (each row is a Vec of raw string values).
has_header: boolWhether the first non-empty line should be treated as a header.
error_count: usizeNumber of parse errors encountered.
Implementations§
Source§impl CsvStreamParser
impl CsvStreamParser
Sourcepub fn column_f64(&self, name: &str) -> Vec<f64>
pub fn column_f64(&self, name: &str) -> Vec<f64>
Extract a column by name as f64 values. Returns empty if header not found.
Sourcepub fn column_f64_by_idx(&self, idx: usize) -> Vec<f64>
pub fn column_f64_by_idx(&self, idx: usize) -> Vec<f64>
Extract a column by index as f64 values.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CsvStreamParser
impl RefUnwindSafe for CsvStreamParser
impl Send for CsvStreamParser
impl Sync for CsvStreamParser
impl Unpin for CsvStreamParser
impl UnsafeUnpin for CsvStreamParser
impl UnwindSafe for CsvStreamParser
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.