Struct noodles_sam::AsyncWriter [−][src]
pub struct AsyncWriter<W> where
W: AsyncWrite, { /* fields omitted */ }
Expand description
An async SAM writer.
Implementations
Creates an async SAM writer.
Examples
use noodles_sam as sam;
let writer = sam::AsyncWriter::new(Vec::new());
Returns a reference to the underlying writer.
Examples
use noodles_sam as sam;
let writer = sam::AsyncWriter::new(Vec::new());
assert!(writer.get_ref().is_empty());
Returns the underlying writer.
Examples
use noodles_sam as sam;
let writer = sam::AsyncWriter::new(Vec::new());
assert!(writer.into_inner().is_empty());
Writes a SAM header.
Examples
use noodles_sam as sam;
let mut writer = sam::AsyncWriter::new(Vec::new());
let header = sam::Header::builder().add_comment("noodles-sam").build();
writer.write_header(&header).await?;
assert_eq!(writer.get_ref(), b"@CO\tnoodles-sam\n");
Writes a SAM record.
Examples
use noodles_sam as sam;
let mut writer = sam::AsyncWriter::new(Vec::new());
let record = sam::Record::default();
writer.write_record(&record).await?;
assert_eq!(writer.get_ref(), b"*\t4\t*\t0\t255\t*\t*\t0\t0\t*\t*\n");