pub struct Writer<W> { /* private fields */ }
Expand description
A FASTA index 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_fasta::fai;
let writer = fai::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_fasta::fai;
let mut writer = fai::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_fasta::fai;
let writer = fai::io::Writer::new(io::sink());
let _inner = writer.into_inner();
source§impl<W> Writer<W>where
W: Write,
impl<W> Writer<W>where
W: Write,
sourcepub fn new(inner: W) -> Self
pub fn new(inner: W) -> Self
Creates a FASTA index writer.
§Examples
use noodles_fasta::fai;
let mut writer = fai::io::Writer::new(Vec::new());
sourcepub fn write_index(&mut self, index: &Index) -> Result<()>
pub fn write_index(&mut self, index: &Index) -> Result<()>
Writes a FASTA index.
§Examples
use noodles_fasta::fai;
let mut writer = fai::io::Writer::new(Vec::new());
let index = fai::Index::from(vec![fai::Record::new("sq0", 13, 5, 80, 81)]);
writer.write_index(&index)?;
assert_eq!(writer.get_ref(), b"sq0\t13\t5\t80\t81\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