pub struct Reader { /* private fields */ }Expand description
A CSV file, positioned at a record boundary.
Implementations§
Source§impl Reader
impl Reader
Sourcepub fn open(file: Box<dyn File>, path: &str) -> Result<Self>
pub fn open(file: Box<dyn File>, path: &str) -> Result<Self>
Opens a file, works out how it is written, and positions it at the first row.
The path is kept because the error a bad value produces names it, the way DuckDB’s does.
§Errors
When the file cannot be read, and when the first block of it does not hold one whole record, which is a single line longer than a megabyte and is not a CSV file anybody meant to write.
Sourcepub fn project(&mut self, columns: &[usize]) -> Result<()>
pub fn project(&mut self, columns: &[usize]) -> Result<()>
Reads only these columns, by position in the file, in this order.
§Errors
When a position is past the end of the file’s columns.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Reader
impl !UnwindSafe for Reader
impl Freeze for Reader
impl Send for Reader
impl Sync for Reader
impl Unpin for Reader
impl UnsafeUnpin for Reader
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