xz2::stream

Struct Filters

Source
pub struct Filters { /* private fields */ }
Expand description

A custom chain of filters to configure an encoding stream.

Implementations§

Source§

impl Filters

Source

pub fn new() -> Filters

Creates a new filter chain with no filters.

Source

pub fn lzma1(&mut self, opts: &LzmaOptions) -> &mut Filters

Add an LZMA1 filter.

LZMA1 is the very same thing as what was called just LZMA in LZMA Utils, 7-Zip, and LZMA SDK. It’s called LZMA1 here to prevent developers from accidentally using LZMA when they actually want LZMA2.

LZMA1 shouldn’t be used for new applications unless you really know what you are doing. LZMA2 is almost always a better choice.

Source

pub fn lzma2(&mut self, opts: &LzmaOptions) -> &mut Filters

Add an LZMA2 filter.

Usually you want this instead of LZMA1. Compared to LZMA1, LZMA2 adds support for SyncFlush, uncompressed chunks (smaller expansion when trying to compress uncompressible data), possibility to change literal_context_bits/literal_position_bits/position_bits in the middle of encoding, and some other internal improvements.

Source

pub fn x86(&mut self) -> &mut Filters

Add a filter for x86 binaries.

Source

pub fn powerpc(&mut self) -> &mut Filters

Add a filter for PowerPC binaries.

Source

pub fn ia64(&mut self) -> &mut Filters

Add a filter for IA-64 (itanium) binaries.

Source

pub fn arm(&mut self) -> &mut Filters

Add a filter for ARM binaries.

Source

pub fn arm_thumb(&mut self) -> &mut Filters

Add a filter for ARM-Thumb binaries.

Source

pub fn sparc(&mut self) -> &mut Filters

Add a filter for SPARC binaries.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.