noodles-sam 0.85.0

Sequence Alignment/Map (SAM) format reader and writer
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use tokio::io::{self, AsyncWrite, AsyncWriteExt};

use crate::Header;

pub(super) async fn write_header<W>(writer: &mut W, header: &Header) -> io::Result<()>
where
    W: AsyncWrite + Unpin,
{
    let mut serializer = crate::io::Writer::new(Vec::new());
    serializer.write_header(header)?;
    writer.write_all(serializer.get_ref()).await
}