Struct noodles::bam::bai::Writer[][src]

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

A BAM index (BAI) writer.

Examples

use noodles_bam::bai;

let index = bai::Index::new(Vec::new(), None);

let mut writer = File::create("sample.bam.bai").map(bai::Writer::new)?;
writer.write_header()?;
writer.write_index(&index)?;

Implementations

Creates a BAI index writer.

Examples

use noodles_bam::bai;
let writer = bai::Writer::new(Vec::new());

Returns a reference to the underlying writer.

Examples

use noodles_bam::bai;
let writer = bai::Writer::new(Vec::new());
assert!(writer.get_ref().is_empty());

Writes a BAM index header.

This writes the magic number of the file format.

Examples

use noodles_bam::bai;

let mut writer = bai::Writer::new(Vec::new());
writer.write_header()?;

assert_eq!(writer.get_ref(), b"BAI\x01");

Writes a BAM index.

Examples

use noodles_bam::bai;

let index = bai::Index::new(Vec::new(), None);

let mut writer = bai::Writer::new(Vec::new());
writer.write_header()?;
writer.write_index(&index)?;

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

Performs the conversion.

Performs the conversion.

Should always be Self

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.