[][src]Struct bam::bgzip::Writer

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

Bgzip writer, that allows to compress and write blocks with uncompressed size at most MAX_BLOCK_SIZE = 65536.

Methods

impl Writer<File>[src]

pub fn from_path<P: AsRef<Path>>(path: P, level: u8) -> Result<Self>[src]

Opens a bgzip writer from a path and compression level. Maximal compression level is 9.

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

pub fn from_stream(stream: W, level: u8) -> Self[src]

Opens a bgzip writer from a stream and compression level. Maximal compression level is 9.

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

Writes an empty block.

pub fn write_several(&mut self, contents: &[&[u8]]) -> Result<()>[src]

Compresses all slices in the contents and writes as a single block.

Sum length of the contents should be at most MAX_BLOCK_SIZE = 65536.

If the compressed block is bigger than MAX_BLOCK_SIZE, the function returns an error WriteZero.

pub fn write(&mut self, contents: &[u8]) -> Result<()>[src]

Compresses contents and writes as a single block.

Input contents size should be at most MAX_BLOCK_SIZE = 65536.

If the compressed block is bigger than MAX_BLOCK_SIZE, the function returns an error WriteZero.

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

Flushes inner stream.

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

impl<T> From<T> for 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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