Struct deflate::write::DeflateEncoder [−][src]
pub struct DeflateEncoder<W: Write> { /* fields omitted */ }
Expand description
A DEFLATE encoder/compressor.
A struct implementing a Write
interface that takes unencoded data and compresses it to
the provided writer using DEFLATE compression.
Examples
use std::io::Write; use deflate::Compression; use deflate::write::DeflateEncoder; let data = b"This is some test data"; let mut encoder = DeflateEncoder::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
) -> DeflateEncoder<W>ⓘNotable traits for DeflateEncoder<W>impl<W: Write> Write for DeflateEncoder<W>
[src]
pub fn new<O: Into<CompressionOptions>>(
writer: W,
options: O
) -> DeflateEncoder<W>ⓘNotable traits for DeflateEncoder<W>impl<W: Write> Write for DeflateEncoder<W>
[src]impl<W: Write> Write for DeflateEncoder<W>
Creates a new encoder using the provided compression options.
Encode all pending data to the contained writer, consume this DeflateEncoder
,
and return the contained writer if writing succeeds.
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 DeflateEncoder<W> where
W: RefUnwindSafe,
impl<W> Send for DeflateEncoder<W> where
W: Send,
impl<W> Sync for DeflateEncoder<W> where
W: Sync,
impl<W> Unpin for DeflateEncoder<W> where
W: Unpin,
impl<W> UnwindSafe for DeflateEncoder<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