pub struct Writer<W> { /* private fields */ }
Expand description
An async FASTQ writer.
Implementations§
source§impl<W> Writer<W>
impl<W> Writer<W>
sourcepub fn get_ref(&self) -> &W
pub fn get_ref(&self) -> &W
Returns a reference to the underlying writer.
§Examples
use noodles_fastq as fastq;
use tokio::io;
let writer = fastq::r#async::io::Writer::new(io::sink());
let _inner = writer.get_ref();
sourcepub fn get_mut(&mut self) -> &mut W
pub fn get_mut(&mut self) -> &mut W
Returns a mutable reference to the underlying writer.
§Examples
use noodles_fastq as fastq;
use tokio::io;
let mut writer = fastq::r#async::io::Writer::new(io::sink());
let _inner = writer.get_mut();
sourcepub fn into_inner(self) -> W
pub fn into_inner(self) -> W
Returns the underlying writer.
§Examples
use noodles_fastq as fastq;
use tokio::io;
let writer = fastq::r#async::io::Writer::new(io::sink());
let _inner = writer.into_inner();
source§impl<W> Writer<W>where
W: AsyncWrite + Unpin,
impl<W> Writer<W>where
W: AsyncWrite + Unpin,
sourcepub fn new(inner: W) -> Self
pub fn new(inner: W) -> Self
Creates an async FASTQ writer.
§Examples
use noodles_fastq as fastq;
use tokio::io;
let writer = fastq::r#async::io::Writer::new(io::sink());
sourcepub async fn write_record(&mut self, record: &Record) -> Result<()>
pub async fn write_record(&mut self, record: &Record) -> Result<()>
Writes a FASTQ record.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let mut writer = fastq::r#async::io::Writer::new(Vec::new());
let record = fastq::Record::new(Definition::new("r0", ""), "ATCG", "NDLS");
writer.write_record(&record).await?;
assert_eq!(writer.get_ref(), b"@r0\nATCG\n+\nNDLS\n");
Auto Trait Implementations§
impl<W> Freeze for Writer<W>where
W: Freeze,
impl<W> RefUnwindSafe for Writer<W>where
W: RefUnwindSafe,
impl<W> Send for Writer<W>where
W: Send,
impl<W> Sync for Writer<W>where
W: Sync,
impl<W> Unpin for Writer<W>where
W: Unpin,
impl<W> UnwindSafe for Writer<W>where
W: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more