Struct yazi::Encoder [−][src]
pub struct Encoder(_);
Expand description
Stateful context for compression.
See the crate level compression section for detailed usage.
Implementations
Creates a new deflate encoder. Note that creating an encoder with this method allocates a large (200-300k) chunk of data on the stack and is likely to cause an overflow if not carefully managed. See the boxed() constructor for a safer method that allocates on the heap.
Sets the format of the output bitstream for the next usage of the encoder.
Sets the compression level for the next usage of the encoder.
Sets the compression strategy for the next usage of the encoder.
pub fn stream<'a, W: Write>(
&'a mut self,
writer: &'a mut W
) -> EncoderStream<'a, impl Sink + 'a>ⓘNotable traits for EncoderStream<'a, S>
impl<'a, S: Sink> Write for EncoderStream<'a, S>
pub fn stream<'a, W: Write>(
&'a mut self,
writer: &'a mut W
) -> EncoderStream<'a, impl Sink + 'a>ⓘNotable traits for EncoderStream<'a, S>
impl<'a, S: Sink> Write for EncoderStream<'a, S>
Creates an encoder stream that will write into the specified writer.
pub fn stream_into_vec<'a>(
&'a mut self,
vec: &'a mut Vec<u8>
) -> EncoderStream<'a, impl Sink + 'a>ⓘNotable traits for EncoderStream<'a, S>
impl<'a, S: Sink> Write for EncoderStream<'a, S>
pub fn stream_into_vec<'a>(
&'a mut self,
vec: &'a mut Vec<u8>
) -> EncoderStream<'a, impl Sink + 'a>ⓘNotable traits for EncoderStream<'a, S>
impl<'a, S: Sink> Write for EncoderStream<'a, S>
Creates an encoder stream that will write into the specified vector. The resulting stream will not clear the vector but will instead append the compressed data.
pub fn stream_into_buf<'a>(
&'a mut self,
buf: &'a mut [u8]
) -> EncoderStream<'a, impl Sink + 'a>ⓘNotable traits for EncoderStream<'a, S>
impl<'a, S: Sink> Write for EncoderStream<'a, S>
pub fn stream_into_buf<'a>(
&'a mut self,
buf: &'a mut [u8]
) -> EncoderStream<'a, impl Sink + 'a>ⓘNotable traits for EncoderStream<'a, S>
impl<'a, S: Sink> Write for EncoderStream<'a, S>
Creates an encoder stream that will write into the specified buffer. The stream will generate an overflow error if the buffer is not large enough to contain the compressed data.
Auto Trait Implementations
impl RefUnwindSafe for Encoder
impl UnwindSafe for Encoder