[][src]Struct libflate_lz77::DefaultLz77EncoderBuilder

pub struct DefaultLz77EncoderBuilder { /* fields omitted */ }

Type for constructing instances of DefaultLz77Encoder.

Examples

use libflate_lz77::{
    DefaultLz77EncoderBuilder,
    MAX_LENGTH,
    MAX_WINDOW_SIZE,
};

// Produce an encoder explicitly with the default window size and max copy length
let _encoder = DefaultLz77EncoderBuilder::new()
    .window_size(MAX_WINDOW_SIZE)
    .max_length(MAX_LENGTH)
    .build();

Methods

impl DefaultLz77EncoderBuilder[src]

pub fn new() -> Self[src]

Create a builder with the default parameters for the encoder.

pub fn window_size(self, window_size: u16) -> Self[src]

Set the size of the sliding search window used during compression.

Larger values require more memory. The standard window size may be unsuitable for a particular Sink; for example, if the encoding used cannot express pointer distances past a certain size, you would want the window size to be no greater than the Sink's limit.

pub fn max_length(self, max_length: u16) -> Self[src]

Set the maximum length of a pointer command this encoder will emit.

Some uses of LZ77 may not be able to encode pointers of the standard maximum length of 258 bytes. In this case, you may set your own maximum which can be encoded by the Sink.

pub fn build(self) -> DefaultLz77Encoder[src]

Build the encoder with the builder state's parameters.

Trait Implementations

impl Debug for DefaultLz77EncoderBuilder[src]

impl Default for DefaultLz77EncoderBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.