Encode

Trait Encode 

Source
pub trait Encode {
    // Required methods
    fn encode(
        &mut self,
        input: &mut PartialBuffer<impl AsRef<[u8]>>,
        output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>,
    ) -> Result<()>;
    fn flush(
        &mut self,
        output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>,
    ) -> Result<bool>;
    fn finish(
        &mut self,
        output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>,
    ) -> Result<bool>;
}

Required Methods§

Source

fn encode( &mut self, input: &mut PartialBuffer<impl AsRef<[u8]>>, output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>, ) -> Result<()>

Source

fn flush( &mut self, output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>, ) -> Result<bool>

Returns whether the internal buffers are flushed

Source

fn finish( &mut self, output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>, ) -> Result<bool>

Returns whether the internal buffers are flushed and the end of the stream is written

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Encode for BrotliEncoder

Available on crate feature brotli only.
Source§

impl Encode for BzEncoder

Available on crate feature bzip2 only.
Source§

impl Encode for DeflateEncoder

Available on crate feature deflate only.
Source§

impl Encode for FlateEncoder

Available on crate feature flate2 only.
Source§

impl Encode for GzipEncoder

Available on crate feature gzip only.
Source§

impl Encode for Lz4Encoder

Available on crate feature lz4 only.
Source§

impl Encode for LzmaEncoder

Available on crate feature lzma only.
Source§

impl Encode for Xz2Encoder

Available on crate feature lzma only.
Source§

impl Encode for XzEncoder

Available on crate feature xz only.
Source§

impl Encode for ZlibEncoder

Available on crate feature zlib only.
Source§

impl Encode for ZstdEncoder

Available on crate feature zstd only.