pub struct MemoryMappedCsvReader { /* private fields */ }Expand description
Memory-mapped CSV reader for efficient processing of large files.
Implementations§
Source§impl MemoryMappedCsvReader
impl MemoryMappedCsvReader
pub fn new(path: &Path) -> Result<Self>
Sourcepub fn read_csv_chunk(
&self,
offset: u64,
chunk_size: usize,
has_headers: bool,
csv_config: Option<&CsvParserConfig>,
) -> Result<(Option<StringRecord>, Vec<StringRecord>, usize)>
pub fn read_csv_chunk( &self, offset: u64, chunk_size: usize, has_headers: bool, csv_config: Option<&CsvParserConfig>, ) -> Result<(Option<StringRecord>, Vec<StringRecord>, usize)>
Parse CSV records from memory-mapped data in chunks.
Returns (headers, records, actual_bytes_consumed).
Sourcepub fn ends_inside_quotes(
&self,
offset: u64,
csv_config: Option<&CsvParserConfig>,
) -> bool
pub fn ends_inside_quotes( &self, offset: u64, csv_config: Option<&CsvParserConfig>, ) -> bool
Whether the file ends inside a quoted field, scanning from offset on.
offset must be a record boundary, such as the offset of a chunk
Self::read_csv_chunk returned. Passing the last chunk’s offset keeps
the scan to that chunk. The CSV parser accepts a quote that is never
closed as a field running to the end of the file, so this is the only
sign of it.
Sourcepub fn estimate_csv_record_count(
&self,
csv_config: Option<&CsvParserConfig>,
) -> Result<usize>
pub fn estimate_csv_record_count( &self, csv_config: Option<&CsvParserConfig>, ) -> Result<usize>
Count logical CSV records, including the header, with a full scan. This shares the record parser with partial counting and avoids prefix bias.
Auto Trait Implementations§
impl Freeze for MemoryMappedCsvReader
impl RefUnwindSafe for MemoryMappedCsvReader
impl Send for MemoryMappedCsvReader
impl Sync for MemoryMappedCsvReader
impl Unpin for MemoryMappedCsvReader
impl UnsafeUnpin for MemoryMappedCsvReader
impl UnwindSafe for MemoryMappedCsvReader
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