Struct bio::io::fasta::Reader

source ·
pub struct Reader<R: Read> { /* private fields */ }
Expand description

A FASTA reader.

Implementations

Read FASTA from given file path.

Create a new Fasta reader given an instance of io::Read.

Example
let reader = Reader::new(fasta_file);

Return an iterator over the records of this Fasta file.

Example
for record in reader.records() {
    let record = record.unwrap();
    assert_eq!(record.id(), "id");
    assert_eq!(record.desc().unwrap(), "desc");
    assert_eq!(record.seq().to_vec(), b"AAAA");
}

Trait Implementations

Formats the value using the given formatter. Read more

Read next FASTA record into the given Record.

Example
let mut record = Record::new();
reader.read(&mut record);

assert_eq!(record.id(), "id");
assert_eq!(record.desc().unwrap(), "desc");
assert_eq!(record.seq().to_vec(), b"AAAA");

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.