/// Read the next FastQ entry into the given [`Record`](#Record).
/// An empty record indicates that no more records can be read.
///
/// This method is useful when you want to read records as fast as
/// possible because it allows the reuse of a `Record` allocation.
///
/// A more ergonomic approach to reading FastQ records is the
/// [records](Reader::records) iterator.
///
/// FastQ files with wrapped sequence and quality strings are allowed.
///
/// # Errors
///
/// This function will return an error if the record is incomplete,
/// syntax is violated or any form of I/O error is encountered.
/// Additionally, if the FastQ file has line-wrapped records, and the wrapping is not
/// consistent between the sequence and quality string for a record, parsing will fail.
///
/// # Example
///
/// ```rust
/// use bio::io::fastq::Record;
/// use bio::io::fastq::{FastqRead, Reader};
/// const FASTQ_FILE: &'static [u8] = b"@id desc
/// AAAA
/// +
/// IIII
/// ";
/// let mut reader = Reader::new(FASTQ_FILE);
/// let mut record = Record::new();
///
/// reader.read(&mut record).unwrap();
///
/// assert_eq!(record.id(), "id");
/// assert_eq!(record.desc().unwrap(), "desc");
/// assert_eq!(record.seq().to_vec(), b"AAAA");
/// assert_eq!(record.qual().to_vec(), b"IIII");
/// ```
Read the next FastQ entry into the given [`Record`](#Record).
An empty record indicates that no more records can be read.

This method is useful when you want to read records as fast as
possible because it allows the reuse of a `Record` allocation.

A more ergonomic approach to reading FastQ records is the
[records](Reader::records) iterator.

FastQ files with wrapped sequence and quality strings are allowed.
Read the next FastQ entry into the given [ ` Record ` ] ( #Record ) . An empty record indicates that no more records can be read . This method is useful when you want to read records as fast as possible because it allows the reuse of a ` Record ` allocation . A more ergonomic approach to reading FastQ records is the [ records ] ( Reader :: records ) iterator . FastQ files with wrapped sequence and quality strings are allowed .
fn read(&mut self, record: &mut Record) -> Result<()> {
        record.clear();
        self.line_buffer.clear();
        self.reader.read_line(&mut self.line_buffer)?;
        if !self.line_buffer.is_empty() {
            if !self.line_buffer.starts_with('@') {
                return Err(Error::MissingAt);
            }
            let mut header_fields = self.line_buffer[1..].trim_end().splitn(2, ' ');
            record.id = header_fields.next().unwrap_or_default().to_owned();
            record.desc = header_fields.next().map(|s| s.to_owned());
            self.line_buffer.clear();
            self.reader.read_line(&mut self.line_buffer)?;
            let mut lines_read = 0;
            while !self.line_buffer.is_empty() && !self.line_buffer.starts_with('+') {
                record.seq.push_str(self.line_buffer.trim_end());
                self.line_buffer.clear();
                self.reader.read_line(&mut self.line_buffer)?;
                lines_read += 1;
            }
            for _ in 0..lines_read {
                self.line_buffer.clear();
                self.reader
                    .read_line(&mut self.line_buffer)
                    .map_err(Error::ReadError)?;
                record.qual.push_str(self.line_buffer.trim_end());
            }
            if record.qual.is_empty() {
                return Err(Error::IncompleteRecord);
            }
        }
        Ok(())
    }
fn read ( & mut self , record : & mut Record ) -> Result < ( ) > { record . clear ( ) ; self . line_buffer . clear ( ) ; self . reader . read_line ( & mut self . line_buffer ) ? ; if ! self . line_buffer . is_empty ( ) { if ! self . line_buffer . starts_with ( '@' ) { return Err ( Error :: MissingAt ) ; } let mut header_fields = self . line_buffer [ 1 .. ] . trim_end ( ) . splitn ( 2 , ' ' ) ; record . id = header_fields . next ( ) . unwrap_or_default ( ) . to_owned ( ) ; record . desc = header_fields . next ( ) . map ( | s | s . to_owned ( ) ) ; self . line_buffer . clear ( ) ; self . reader . read_line ( & mut self . line_buffer ) ? ; let mut lines_read = 0 ; while ! self . line_buffer . is_empty ( ) && ! self . line_buffer . starts_with ( '+' ) { record . seq . push_str ( self . line_buffer . trim_end ( ) ) ; self . line_buffer . clear ( ) ; self . reader . read_line ( & mut self . line_buffer ) ? ; lines_read += 1 ; } for _ in 0 .. lines_read { self . line_buffer . clear ( ) ; self . reader . read_line ( & mut self . line_buffer ) . map_err ( Error :: ReadError ) ? ; record . qual . push_str ( self . line_buffer . trim_end ( ) ) ; } if record . qual . is_empty ( ) { return Err ( Error :: IncompleteRecord ) ; } } Ok ( ( ) ) }
Read the next FastQ entry into the given [`Record`](#Record).
Read the next FastQ entry into the given [ ` Record ` ] ( #Record ) .
&mut self
record
&mut Record
errors
This function will return an error if the record is incomplete,
syntax is violated or any form of I/O error is encountered.
Additionally, if the FastQ file has line-wrapped records, and the wrapping is not
consistent between the sequence and quality string for a record, parsing will fail.
This function will return an error if the record is incomplete syntax is violated or any form of I / O error is encountered . Additionally if the FastQ file has line - wrapped records and the wrapping is not consistent between the sequence and quality string for a record parsing will fail .
example
```rust
use bio::io::fastq::Record;
use bio::io::fastq::{FastqRead, Reader};
const FASTQ_FILE: &'static [u8] = b"@id desc
AAAA

IIII
";
let mut reader = Reader::new(FASTQ_FILE);
let mut record = Record::new().

reader.read(&mut record).unwrap().


` ` ` rust use bio :: io :: fastq :: Record ; use bio :: io :: fastq :: { FastqRead Reader } ; const FASTQ_FILE : & ' static [ u8 ] = b " @id desc AAAA IIII " ; let mut reader = Reader :: new ( FASTQ_FILE ) ; let mut record = Record :: new () . reader . read ( &mut record ) . unwrap () .