[−][src]Struct libflate::gzip::EncodeOptions
Options for a GZIP encoder.
Methods
impl EncodeOptions<DefaultLz77Encoder>
[src][−]
pub fn new() -> Self
[src][−]
Makes a default instance.
Examples
use libflate::gzip::{Encoder, EncodeOptions}; let options = EncodeOptions::new(); let encoder = Encoder::with_options(Vec::new(), options).unwrap();
impl<E> EncodeOptions<E> where
E: Lz77Encode,
[src][−]
E: Lz77Encode,
pub fn with_lz77(lz77: E) -> Self
[src][−]
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();
pub fn no_compression(self) -> Self
[src][−]
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();
pub fn header(self, header: Header) -> Self
[src][−]
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();
pub fn block_size(self, size: usize) -> Self
[src][−]
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();
pub fn fixed_huffman_codes(self) -> Self
[src][−]
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
impl Default for EncodeOptions<DefaultLz77Encoder>
[src][+]
impl<E: Debug> Debug for EncodeOptions<E> where
E: Lz77Encode,
[src][+]
E: Lz77Encode,
Auto Trait Implementations
impl<E> Send for EncodeOptions<E> where
E: Send,
E: Send,
impl<E> Sync for EncodeOptions<E> where
E: Sync,
E: Sync,
Blanket Implementations
impl<T> From for T
[src][−]
impl<T, U> Into for T where
U: From<T>,
[src][−]
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src][−]
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src][−]
impl<T> Borrow for T where
T: ?Sized,
[src][−]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src][−]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src][−]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src][−]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src][−]
impl<T> Any for T where
T: 'static + ?Sized,
[src][−]
T: 'static + ?Sized,