[][src]Struct libflate_lz77::DefaultLz77Encoder

pub struct DefaultLz77Encoder { /* fields omitted */ }

A Lz77Encode implementation used by default.

Methods

impl DefaultLz77Encoder[src]

pub fn new() -> Self[src]

Makes a new encoder instance.

Examples

use libflate::deflate;
use libflate::lz77::{self, Lz77Encode, DefaultLz77Encoder};

let lz77 = DefaultLz77Encoder::new();
assert_eq!(lz77.window_size(), lz77::MAX_WINDOW_SIZE);

let options = deflate::EncodeOptions::with_lz77(lz77);
let _deflate = deflate::Encoder::with_options(Vec::new(), options);

pub fn with_window_size(size: u16) -> Self[src]

Makes a new encoder instance with specified window size.

Larger window size is prefered to raise compression ratio, but it may require more working memory to encode and decode data.

Examples

use libflate::deflate;
use libflate::lz77::{self, Lz77Encode, DefaultLz77Encoder};

let lz77 = DefaultLz77Encoder::with_window_size(1024);
assert_eq!(lz77.window_size(), 1024);

let options = deflate::EncodeOptions::with_lz77(lz77);
let _deflate = deflate::Encoder::with_options(Vec::new(), options);

Trait Implementations

impl Debug for DefaultLz77Encoder[src]

impl Default for DefaultLz77Encoder[src]

impl Lz77Encode for DefaultLz77Encoder[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.