[][src]Struct bam::bgzip::SentenceWriter

pub struct SentenceWriter<W: Write> { /* fields omitted */ }

A struct that allows to write bgzip files in sentences.

It implements a Write trait, and works similar to a BufWriter, but has a method end_sentence, that indicates the end of a block of the same nature (for example, a BAM record can represent a single sentence). Method flush ignores sentences and immediately writes the remaining buffer.

The SentenceWriter will try to start new bgzip blocks only when a new sentence starts. The writer still puts several sentences in the same bgzip block, if possible.

Methods

impl<W: Write> SentenceWriter<W>[src]

pub fn new(writer: Writer<W>) -> Self[src]

pub fn end_sentence(&mut self)[src]

Ends the current sentence.

pub fn finish(&mut self) -> Result<()>[src]

Writes all the remaining contents to bgzip and an empty block.

Trait Implementations

impl<W: Write> Drop for SentenceWriter<W>[src]

impl<W: Write> Write for SentenceWriter<W>[src]

Auto Trait Implementations

impl<W> Send for SentenceWriter<W> where
    W: Send

impl<W> Sync for SentenceWriter<W> where
    W: Sync

impl<W> Unpin for SentenceWriter<W> where
    W: Unpin

impl<W> UnwindSafe for SentenceWriter<W> where
    W: UnwindSafe

impl<W> RefUnwindSafe for SentenceWriter<W> where
    W: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<W> WriteBytesExt for W where
    W: Write + ?Sized
[src]