pub struct LzmaOptions {
pub dict_size: u32,
pub lc: u32,
pub lp: u32,
pub pb: u32,
pub mode: EncodeMode,
pub nice_len: u32,
pub mf: MfType,
pub depth_limit: i32,
pub preset_dict: Option<Vec<u8>>,
}
Available on crate feature
encoder
only.Expand description
Encoder settings when compressing with LZMA and LZMA2.
Fields§
§dict_size: u32
Dictionary size in bytes.
lc: u32
Number of literal context bits (0-8).
lp: u32
Number of literal position bits (0-4).
pb: u32
Number of position bits (0-4).
mode: EncodeMode
Compression mode.
nice_len: u32
Match finder nice length.
mf: MfType
Match finder type.
depth_limit: i32
Match finder depth limit.
preset_dict: Option<Vec<u8>>
Preset dictionary data.
Implementations§
Source§impl LzmaOptions
impl LzmaOptions
Sourcepub const LC_DEFAULT: u32 = 3u32
pub const LC_DEFAULT: u32 = 3u32
Default number of literal context bits.
Sourcepub const LP_DEFAULT: u32 = 0u32
pub const LP_DEFAULT: u32 = 0u32
Default number of literal position bits.
Sourcepub const PB_DEFAULT: u32 = 2u32
pub const PB_DEFAULT: u32 = 2u32
Default number of position bits.
Sourcepub const NICE_LEN_MAX: u32 = 273u32
pub const NICE_LEN_MAX: u32 = 273u32
Maximum match finder nice length.
Sourcepub const NICE_LEN_MIN: u32 = 8u32
pub const NICE_LEN_MIN: u32 = 8u32
Minimum match finder nice length.
Sourcepub const DICT_SIZE_DEFAULT: u32 = 8_388_608u32
pub const DICT_SIZE_DEFAULT: u32 = 8_388_608u32
Default dictionary size (8MB).
Sourcepub fn new(
dict_size: u32,
lc: u32,
lp: u32,
pb: u32,
mode: EncodeMode,
nice_len: u32,
mf: MfType,
depth_limit: i32,
) -> Self
pub fn new( dict_size: u32, lc: u32, lp: u32, pb: u32, mode: EncodeMode, nice_len: u32, mf: MfType, depth_limit: i32, ) -> Self
Creates new LZMA encoding options with specified parameters.
Sourcepub fn with_preset(preset: u32) -> Self
pub fn with_preset(preset: u32) -> Self
preset: [0..9]
Sourcepub fn set_preset(&mut self, preset: u32)
pub fn set_preset(&mut self, preset: u32)
preset: [0..9]
Sourcepub fn get_memory_usage(&self) -> u32
pub fn get_memory_usage(&self) -> u32
Returns the estimated memory usage in kilobytes for these options.
Trait Implementations§
Source§impl Clone for LzmaOptions
impl Clone for LzmaOptions
Source§fn clone(&self) -> LzmaOptions
fn clone(&self) -> LzmaOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LzmaOptions
impl Debug for LzmaOptions
Auto Trait Implementations§
impl Freeze for LzmaOptions
impl RefUnwindSafe for LzmaOptions
impl Send for LzmaOptions
impl Sync for LzmaOptions
impl Unpin for LzmaOptions
impl UnwindSafe for LzmaOptions
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