[][src]Trait bio::io::fastq::FastqRead

pub trait FastqRead {
    fn read(&mut self, record: &mut Record) -> Result<()>;
}

Trait for FASTQ readers.

Required methods

fn read(&mut self, record: &mut Record) -> Result<()>

Loading content...

Implementors

impl<R> FastqRead for Reader<R> where
    R: Read
[src]

fn read(&mut self, record: &mut Record) -> Result<()>[src]

Read the next FASTQ entry into the given 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 iterator.

Errors

This function will return an error if the record is incomplete, syntax is violated or any form of I/O error is encountered.

Example

const fastq_file: &'static [u8] = b"@id desc
AAAA
+
IIII
";
let mut reader = Reader::new(fastq_file);
let mut record = Record::new();

// Check for errors parsing the record
reader.read(&mut record)?;

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");
Loading content...