pub struct ByteRecord { /* private fields */ }Expand description
An owned, unquoted/unescaped representation of a CSV record.
ByteRecord are typically used with a Reader.
Creating a ByteRecord:
use simd_csv::ByteRecord;
let mut record = ByteRecord::new();
record.push_field(b"john");
record.push_field(b"landis");Implementations§
Source§impl ByteRecord
impl ByteRecord
Sourcepub fn with_capacity(buffer: usize, fields: usize) -> Self
pub fn with_capacity(buffer: usize, fields: usize) -> Self
Create a new record with given capacity.
Sourcepub fn truncate(&mut self, len: usize)
pub fn truncate(&mut self, len: usize)
Shortens the record, keeping the first len elements and dropping the
rest.
Sourcepub fn as_slice(&self) -> &[u8] ⓘ
pub fn as_slice(&self) -> &[u8] ⓘ
Return the underlying byte slice.
BEWARE: the Reader amortizes copies by sometimes
including spurious data such as quotes and delimiters. You will never
see those bytes while accessing fields because the field boundaries
remain correct, but you will see them in the underlying slice.
Sourcepub fn push_field(&mut self, bytes: &[u8])
pub fn push_field(&mut self, bytes: &[u8])
Push a new field to the back of the record.
Sourcepub fn fmt_field<F: Display>(&mut self, target: &F)
pub fn fmt_field<F: Display>(&mut self, target: &F)
Push a new field to the back of the record by formatting given fmt::Display
target into this record’s bytes directly.
Sourcepub fn write_field<F>(&mut self, callback: F)
pub fn write_field<F>(&mut self, callback: F)
Push a new field to the back of the record by writing to this record’s back directly using a callback.
Trait Implementations§
Source§impl AsRef<ByteRecord> for ByteHeadersIndex
impl AsRef<ByteRecord> for ByteHeadersIndex
Source§fn as_ref(&self) -> &ByteRecord
fn as_ref(&self) -> &ByteRecord
Source§impl Clone for ByteRecord
impl Clone for ByteRecord
Source§impl Debug for ByteRecord
impl Debug for ByteRecord
Source§impl Default for ByteRecord
impl Default for ByteRecord
impl Eq for ByteRecord
Source§impl<T: AsRef<[u8]>> Extend<T> for ByteRecord
impl<T: AsRef<[u8]>> Extend<T> for ByteRecord
Source§fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)