pub struct CsvRecordCodec { /* private fields */ }Available on crate feature
csv only.Expand description
A Decoder that yields one csv::ByteRecord per CSV record.
Not generic over the item type: see the module docs.
Implementations§
Source§impl CsvRecordCodec
impl CsvRecordCodec
Sourcepub fn new(config: CsvFrameConfig, has_headers: bool, max_len: usize) -> Self
pub fn new(config: CsvFrameConfig, has_headers: bool, max_len: usize) -> Self
A framer reading records per config, skipping a leading header row if has_headers.
Trait Implementations§
Source§impl Debug for CsvRecordCodec
impl Debug for CsvRecordCodec
Source§impl Decoder for CsvRecordCodec
impl Decoder for CsvRecordCodec
Source§type Item = ByteRecord
type Item = ByteRecord
A framed record, not yet deserialised. Errors here are framing errors and are terminal.
Source§type Error = StreamError
type Error = StreamError
The type of unrecoverable frame decoding errors. Read more
Source§fn decode(
&mut self,
buf: &mut BytesMut,
) -> Result<Option<Self::Item>, StreamError>
fn decode( &mut self, buf: &mut BytesMut, ) -> Result<Option<Self::Item>, StreamError>
Attempts to decode a frame from the provided buffer of bytes. Read more
Source§fn decode_eof(
&mut self,
buf: &mut BytesMut,
) -> Result<Option<Self::Item>, StreamError>
fn decode_eof( &mut self, buf: &mut BytesMut, ) -> Result<Option<Self::Item>, StreamError>
A default method available to be called when there are no more bytes
available to be read from the underlying I/O. Read more
Auto Trait Implementations§
impl Freeze for CsvRecordCodec
impl RefUnwindSafe for CsvRecordCodec
impl Send for CsvRecordCodec
impl Sync for CsvRecordCodec
impl Unpin for CsvRecordCodec
impl UnsafeUnpin for CsvRecordCodec
impl UnwindSafe for CsvRecordCodec
Blanket Implementations§
impl<T> Allocation for T
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