Struct flate2::write::GzEncoder
[−]
[src]
pub struct GzEncoder<W: Write> { // some fields omitted }
A gzip streaming encoder
This structure exposes a Write
interface that will emit compressed data
to the underlying writer W
.
Methods
impl<W: Write> EncoderWriter<W>
[src]
fn new(w: W, level: Compression) -> EncoderWriter<W>
Creates a new encoder which will use the given compression level.
The encoder is not configured specially for the emitted header. For
header configuration, see the Builder
type.
The data written to the returned encoder will be compressed and then
written to the stream w
.
fn finish(self) -> Result<W>
Finish encoding this stream, returning the underlying writer once the encoding is done.
Trait Implementations
impl<W: Write> Write for EncoderWriter<W>
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer into this object, returning how many bytes were written. Read more
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0
Attempts to write an entire buffer into this write. Read more
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0
Writes a formatted string into this writer, returning any error encountered. Read more
fn by_ref(&mut self) -> &mut Self
1.0.0
Creates a "by reference" adaptor for this instance of Write
. Read more