pub struct TotalReader<'b> { /* private fields */ }Expand description
An already configured CSV reader working on a slice of bytes or on a memory map.
§Configuration
To configure a TotalReader, if you need a custom delimiter for instance
of if you want to tweak the size of the inner buffer. Check out the
TotalReaderBuilder.
Implementations§
Source§impl<'b> TotalReader<'b>
impl<'b> TotalReader<'b>
Sourcepub fn from_bytes(bytes: &'b [u8]) -> Self
pub fn from_bytes(bytes: &'b [u8]) -> Self
Create a new reader with default configuration using the provided byte slice.
Sourcepub fn byte_headers(&mut self) -> &ByteRecord
pub fn byte_headers(&mut self) -> &ByteRecord
Returns whether this reader has been configured to interpret the first record as a header.
Sourcepub fn count_records(&mut self) -> u64
pub fn count_records(&mut self) -> u64
Count the total number of records.
Sourcepub fn split_record(&mut self) -> Option<&[u8]>
pub fn split_record(&mut self) -> Option<&[u8]>
Attempt to split the next CSV record and return an optional reference to its byte slice.
Returns Ok(None) when the reader is fully consumed.
Sourcepub fn read_byte_record(&mut self, record: &mut ByteRecord) -> bool
pub fn read_byte_record(&mut self, record: &mut ByteRecord) -> bool
Attempt to read the next CSV record into a pre-allocated ByteRecord.
Returns a boolean indicating whether a record was actually read or if we reached the end of the stream.
Sourcepub fn byte_records<'r>(&'r mut self) -> ByteRecordsIter<'r, 'b>
pub fn byte_records<'r>(&'r mut self) -> ByteRecordsIter<'r, 'b>
Return an iterator yielding ByteRecord structs.