[go: up one dir, main page]

Lz77Encode

Trait Lz77Encode 

Source
pub trait Lz77Encode {
    // Required methods
    fn encode<S>(&mut self, buf: &[u8], sink: S)
       where S: Sink;
    fn flush<S>(&mut self, sink: S)
       where S: Sink;

    // Provided methods
    fn compression_level(&self) -> CompressionLevel { ... }
    fn window_size(&self) -> u16 { ... }
}
Expand description

The Lz77Encode trait defines the interface of LZ77 encoding algorithm.

Required Methods§

Source

fn encode<S>(&mut self, buf: &[u8], sink: S)
where S: Sink,

Encodes a buffer and writes result LZ77 codes to sink.

Source

fn flush<S>(&mut self, sink: S)
where S: Sink,

Flushes the encoder, ensuring that all intermediately buffered codes are consumed by sink.

Provided Methods§

Source

fn compression_level(&self) -> CompressionLevel

Returns the compression level of the encoder.

If the implementation is omitted, CompressionLevel::Balance will be returned.

Source

fn window_size(&self) -> u16

Returns the window size of the encoder.

If the implementation is omitted, MAX_WINDOW_SIZE will be returned.

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§