pub fn eof(&mut self, bytes: &mut &[u8]) -> Result<Option<Row>, DecodeError> {
        match &mut self.inner {
            DataDecoderInner::Csv(csv) => {
                let result = csv.decode(bytes);
                csv.reset_for_new_object();
                result
            }
            DataDecoderInner::DelimitedBytes { format, .. } => {
                let data = std::mem::take(bytes);
                // If we hit EOF with no bytes left in the buffer it means the file had a trailing
                // \n character that can be ignored. Otherwise, we decode the final bytes as normal
                if data.is_empty() {
                    Ok(None)
                } else {
                    format.decode(data)
                }
            }
            _ => Ok(None),
        }
    }
/// Get the next record if it exists, assuming an EOF has occurred.
///
/// This is distinct from `next` because, for example, a CSV record should be returned even if it
/// does not end in a newline.
Get the next record if it exists, assuming an EOF has occurred.
This is distinct from `next` because, for example, a CSV record should be returned even if it
does not end in a newline.
Get the next record if it exists assuming an EOF has occurred . This is distinct from ` next ` because for example a CSV record should be returned even if it does not end in a newline .
pub fn eof(&mut self, bytes: &mut &[u8]) -> Result<Option<Row>, DecodeError> {
        match &mut self.inner {
            DataDecoderInner::Csv(csv) => {
                let result = csv.decode(bytes);
                csv.reset_for_new_object();
                result
            }
            DataDecoderInner::DelimitedBytes { format, .. } => {
                let data = std::mem::take(bytes);
                // If we hit EOF with no bytes left in the buffer it means the file had a trailing
                // \n character that can be ignored. Otherwise, we decode the final bytes as normal
                if data.is_empty() {
                    Ok(None)
                } else {
                    format.decode(data)
                }
            }
            _ => Ok(None),
        }
    }
pub fn eof ( & mut self , bytes : & mut & [ u8 ] ) -> Result < Option < Row > , DecodeError > { match & mut self . inner { DataDecoderInner :: Csv ( csv ) => { let result = csv . decode ( bytes ) ; csv . reset_for_new_object ( ) ; result } DataDecoderInner :: DelimitedBytes { format , .. } => { let data = std :: mem :: take ( bytes ) ; // If we hit EOF with no bytes left in the buffer it means the file had a trailing // \n character that can be ignored. Otherwise, we decode the final bytes as normal if data . is_empty ( ) { Ok ( None ) } else { format . decode ( data ) } } _ => Ok ( None ) , } }
Get the next record if it exists, assuming an EOF has occurred.
Get the next record if it exists assuming an EOF has occurred .
&mut self
bytes
&mut &[u8]
&mut self
bytes
&mut &[u8]