Struct flate2::write::DeflateEncoder [-] [+] [src]

pub struct DeflateEncoder<W: Write> {
    // some fields omitted
}

A DEFLATE encoder, or compressor.

This structure implements a Write interface and takes a stream of uncompressed data, writing the compressed data to the wrapped writer.

Methods

impl<W: Write> EncoderWriter<W>

fn new(w: W, level: Compression) -> EncoderWriter<W>

Creates a new encoder which will write compressed data to the stream given at the given compression level.

When this encoder is dropped or unwrapped the final pieces of data will be flushed.

fn finish(self) -> Result<W>

Consumes this encoder, flushing the output stream.

This will flush the underlying data stream and then return the contained writer if the flush succeeded.

Trait Implementations

impl<W: Write> Write for EncoderWriter<W>

fn write(&mut self, buf: &[u8]) -> Result<usize>

fn flush(&mut self) -> Result<()>

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>

fn by_ref(&mut self) -> &mut Self

fn broadcast<W>(self, other: W) -> Broadcast<Self, W> where W: Write