pub struct EncodeOptions<E> where
    E: Lz77Encode
{ header: Header, options: EncodeOptions<E>, }
Expand description

Options for a GZIP encoder.

Fields

header: Headeroptions: EncodeOptions<E>

Implementations

Makes a default instance.

Examples
use libflate::gzip::{Encoder, EncodeOptions};

let options = EncodeOptions::new();
let encoder = Encoder::with_options(Vec::new(), options).unwrap();

Specifies the LZ77 encoder used to compress input data.

Example
use libflate::lz77::DefaultLz77Encoder;
use libflate::gzip::{Encoder, EncodeOptions};

let options = EncodeOptions::with_lz77(DefaultLz77Encoder::new());
let encoder = Encoder::with_options(Vec::new(), options).unwrap();

Disables LZ77 compression.

Example
use libflate::lz77::DefaultLz77Encoder;
use libflate::gzip::{Encoder, EncodeOptions};

let options = EncodeOptions::new().no_compression();
let encoder = Encoder::with_options(Vec::new(), options).unwrap();

Sets the GZIP header which will be written to the output stream.

Example
use libflate::gzip::{Encoder, EncodeOptions, HeaderBuilder};

let header = HeaderBuilder::new().text().modification_time(100).finish();
let options = EncodeOptions::new().header(header);
let encoder = Encoder::with_options(Vec::new(), options).unwrap();

Specifies the hint of the size of a DEFLATE block.

The default value is deflate::DEFAULT_BLOCK_SIZE.

Example
use libflate::gzip::{Encoder, EncodeOptions};

let options = EncodeOptions::new().block_size(512 * 1024);
let encoder = Encoder::with_options(Vec::new(), options).unwrap();

Specifies to compress with fixed huffman codes.

Example
use libflate::gzip::{Encoder, EncodeOptions};

let options = EncodeOptions::new().fixed_huffman_codes();
let encoder = Encoder::with_options(Vec::new(), options).unwrap();

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.