pub struct Writer<W> { /* private fields */ }
Expand description

A FASTA writer.

Implementations

Creates a FASTA writer builder.

Examples
use noodles_fasta as fasta;
let writer = fasta::Writer::builder(Vec::new()).build();

Creates a FASTA writer.

Examples
use noodles_fasta as fasta;
let writer = fasta::Writer::new(Vec::new());

Returns a reference to the underlying writer.

Examples
use noodles_fasta as fasta;
let writer = fasta::Writer::new(Vec::new());
assert!(writer.get_ref().is_empty());

Writes a FASTA record.

Sequence lines are hard wrapped at 80 bases.

Examples
use noodles_fasta::{self as fasta, record::{Definition, Sequence}};

let mut writer = fasta::Writer::new(Vec::new());

let definition = Definition::new("sq0", None);
let sequence = Sequence::from(b"ACGT".to_vec());
let record = fasta::Record::new(definition, sequence);

writer.write_record(&record)?;

assert_eq!(writer.get_ref(), b">sq0\nACGT\n");

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.