pub fn read(&mut self, record: &mut Record) -> io::Result<()> {
        record.clear();

        let mut header = String::new();
        try!(self.reader.read_line(&mut header));

        if !header.is_empty() {
            if !header.starts_with('@') {
                return Err(io::Error::new(
                    io::ErrorKind::Other,
                    "Expected @ at record start.",
                ));
            }
            record.id = header[1..]
                .trim_right()
                .splitn(2, ' ')
                .nth(0)
                .unwrap_or_default()
                .to_owned();
            record.desc = header[1..]
                .trim_right()
                .splitn(2, ' ')
                .nth(1)
                .map(|s| s.to_owned());
            try!(self.reader.read_line(&mut record.seq));
            try!(self.reader.read_line(&mut self.sep_line));
            try!(self.reader.read_line(&mut record.qual));
            if record.qual.is_empty() {
                return Err(io::Error::new(
                    io::ErrorKind::Other,
                    "Incomplete record. Each FastQ record has to consist \
                     of 4 lines: header, sequence, separator and \
                     qualities.",
                ));
            }
        }

        Ok(())
    }
/// Read into a given record.
/// Returns an error if the record in incomplete or syntax is violated.
/// The content of the record can be checked via the record object.
Read into a given record.
Returns an error if the record in incomplete or syntax is violated.
The content of the record can be checked via the record object.
Read into a given record . Returns an error if the record in incomplete or syntax is violated . The content of the record can be checked via the record object .
pub fn read(&mut self, record: &mut Record) -> io::Result<()> {
        record.clear();
        let mut header = String::new();
        try!(self.reader.read_line(&mut header));
        if !header.is_empty() {
            if !header.starts_with('@') {
                return Err(io::Error::new(
                    io::ErrorKind::Other,
                    "Expected @ at record start.",
                ));
            }
            record.id = header[1..]
                .trim_right()
                .splitn(2, ' ')
                .nth(0)
                .unwrap_or_default()
                .to_owned();
            record.desc = header[1..]
                .trim_right()
                .splitn(2, ' ')
                .nth(1)
                .map(|s| s.to_owned());
            try!(self.reader.read_line(&mut record.seq));
            try!(self.reader.read_line(&mut self.sep_line));
            try!(self.reader.read_line(&mut record.qual));
            if record.qual.is_empty() {
                return Err(io::Error::new(
                    io::ErrorKind::Other,
                    "Incomplete record. Each FastQ record has to consist \
                     of 4 lines: header, sequence, separator and \
                     qualities.",
                ));
            }
        }
        Ok(())
    }
pub fn read ( & mut self , record : & mut Record ) -> io :: Result < ( ) > { record . clear ( ) ; let mut header = String :: new ( ) ; try ! ( self reader read_line ( mut header ) ) ; if ! header . is_empty ( ) { if ! header . starts_with ( '@' ) { return Err ( io :: Error :: new ( io :: ErrorKind :: Other , " " , ) ) ; } record . id = header [ 1 .. ] . trim_right ( ) . splitn ( 2 , ' ' ) . nth ( 0 ) . unwrap_or_default ( ) . to_owned ( ) ; record . desc = header [ 1 .. ] . trim_right ( ) . splitn ( 2 , ' ' ) . nth ( 1 ) . map ( | s | s . to_owned ( ) ) ; try ! ( self reader read_line ( mut record seq ) ) ; try ! ( self reader read_line ( mut self sep_line ) ) ; try ! ( self reader read_line ( mut record qual ) ) ; if record . qual . is_empty ( ) { return Err ( io :: Error :: new ( io :: ErrorKind :: Other , " \
 \
 " , ) ) ; } } Ok ( ( ) ) }
Read into a given record.
Read into a given record .
&mut self
record
&mut Record
&mut self
record
&mut Record