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.
Trait Implementations§
source§impl Debug for DefaultLz77EncoderBuilder
impl Debug for DefaultLz77EncoderBuilder
Auto Trait Implementations§
impl Freeze for DefaultLz77EncoderBuilder
impl RefUnwindSafe for DefaultLz77EncoderBuilder
impl Send for DefaultLz77EncoderBuilder
impl Sync for DefaultLz77EncoderBuilder
impl Unpin for DefaultLz77EncoderBuilder
impl UnwindSafe for DefaultLz77EncoderBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more