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 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])
Append a new field to the back of the record.
Trait Implementations§
Source§impl Clone for ByteRecord
impl Clone for ByteRecord
Source§fn clone(&self) -> ByteRecord
fn clone(&self) -> ByteRecord
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ByteRecord
impl Debug for ByteRecord
Source§impl Default for ByteRecord
impl Default for ByteRecord
Source§fn default() -> ByteRecord
fn default() -> ByteRecord
Returns the “default value” for a type. Read more
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)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<I, T> From<I> for ByteRecord
impl<I, T> From<I> for ByteRecord
Source§impl<T: AsRef<[u8]>> FromIterator<T> for ByteRecord
impl<T: AsRef<[u8]>> FromIterator<T> for ByteRecord
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl Hash for ByteRecord
impl Hash for ByteRecord
Source§impl Index<usize> for ByteRecord
impl Index<usize> for ByteRecord
Source§impl<'r> IntoIterator for &'r ByteRecord
impl<'r> IntoIterator for &'r ByteRecord
Source§impl PartialEq for ByteRecord
impl PartialEq for ByteRecord
impl Eq for ByteRecord
Auto Trait Implementations§
impl Freeze for ByteRecord
impl RefUnwindSafe for ByteRecord
impl Send for ByteRecord
impl Sync for ByteRecord
impl Unpin for ByteRecord
impl UnwindSafe for ByteRecord
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