Struct deflate::write::ZlibEncoder [−][src]
pub struct ZlibEncoder<W: Write> { /* fields omitted */ }
Expand description
A Zlib encoder/compressor.
A struct implementing a Write
interface that takes unencoded data and compresses it to
the provided writer using DEFLATE compression with Zlib headers and trailers.
Examples
use std::io::Write; use deflate::Compression; use deflate::write::ZlibEncoder; let data = b"This is some test data"; let mut encoder = ZlibEncoder::new(Vec::new(), Compression::Default); encoder.write_all(data)?; let compressed_data = encoder.finish()?;
Implementations
pub fn new<O: Into<CompressionOptions>>(writer: W, options: O) -> ZlibEncoder<W>ⓘNotable traits for ZlibEncoder<W>impl<W: Write> Write for ZlibEncoder<W>
[src]
pub fn new<O: Into<CompressionOptions>>(writer: W, options: O) -> ZlibEncoder<W>ⓘNotable traits for ZlibEncoder<W>impl<W: Write> Write for ZlibEncoder<W>
[src]impl<W: Write> Write for ZlibEncoder<W>
Create a new ZlibEncoder
using the provided compression options.
Encode all pending data to the contained writer, consume this ZlibEncoder
,
and return the contained writer if writing succeeds.
Resets the encoder (except the compression options), replacing the current writer with a new one, returning the old one.
Trait Implementations
Flush the encoder.
This will flush the encoder, emulating the Sync flush method from Zlib. This essentially finishes the current block, and sends an additional empty stored block to the writer.
Write a buffer into this writer, returning how many bytes were written. Read more
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
Attempts to write an entire buffer into this writer. Read more
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Writes a formatted string into this writer, returning any error encountered. Read more
Auto Trait Implementations
impl<W> RefUnwindSafe for ZlibEncoder<W> where
W: RefUnwindSafe,
impl<W> Send for ZlibEncoder<W> where
W: Send,
impl<W> Sync for ZlibEncoder<W> where
W: Sync,
impl<W> Unpin for ZlibEncoder<W> where
W: Unpin,
impl<W> UnwindSafe for ZlibEncoder<W> where
W: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Writes an unsigned 8 bit integer to the underlying writer. Read more
Writes a signed 8 bit integer to the underlying writer. Read more
Writes an unsigned 16 bit integer to the underlying writer. Read more
Writes a signed 16 bit integer to the underlying writer. Read more
Writes an unsigned 24 bit integer to the underlying writer. Read more
Writes a signed 24 bit integer to the underlying writer. Read more
Writes an unsigned 32 bit integer to the underlying writer. Read more
Writes a signed 32 bit integer to the underlying writer. Read more
Writes an unsigned 48 bit integer to the underlying writer. Read more
Writes a signed 48 bit integer to the underlying writer. Read more
Writes an unsigned 64 bit integer to the underlying writer. Read more
Writes a signed 64 bit integer to the underlying writer. Read more
Writes an unsigned 128 bit integer to the underlying writer.
Writes a signed 128 bit integer to the underlying writer.
Writes an unsigned n-bytes integer to the underlying writer. Read more
Writes a signed n-bytes integer to the underlying writer. Read more
Writes an unsigned n-bytes integer to the underlying writer. Read more
Writes a signed n-bytes integer to the underlying writer. Read more
Writes a IEEE754 single-precision (4 bytes) floating point number to the underlying writer. Read more