Struct libflate_lz77::DefaultLz77EncoderBuilder
source · pub struct DefaultLz77EncoderBuilder { /* private fields */ }
Expand description
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();
Implementations§
source§impl DefaultLz77EncoderBuilder
impl DefaultLz77EncoderBuilder
sourcepub fn window_size(self, window_size: u16) -> Self
pub fn window_size(self, window_size: u16) -> Self
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.
sourcepub fn max_length(self, max_length: u16) -> Self
pub fn max_length(self, max_length: u16) -> Self
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.
sourcepub fn build(self) -> DefaultLz77Encoder
pub fn build(self) -> DefaultLz77Encoder
Build the encoder with the builder state’s parameters.