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>>,
}Expand description
Encoder settings when compressing with LZMA and LZMA2.
Fields§
§dict_size: u32Dictionary size in bytes.
lc: u32Number of literal context bits (0-8).
lp: u32Number of literal position bits (0-4).
pb: u32Number of position bits (0-4).
mode: EncodeModeCompression mode.
nice_len: u32Match finder nice length.
mf: MfTypeMatch finder type.
depth_limit: i32Match finder depth limit.
preset_dict: Option<Vec<u8>>Preset dictionary data.
Implementations§
Source§impl LzmaOptions
impl LzmaOptions
Sourcepub const LC_DEFAULT: u32 = 3u32
Available on crate feature encoder only.
pub const LC_DEFAULT: u32 = 3u32
encoder only.Default number of literal context bits.
Sourcepub const LP_DEFAULT: u32 = 0u32
Available on crate feature encoder only.
pub const LP_DEFAULT: u32 = 0u32
encoder only.Default number of literal position bits.
Sourcepub const PB_DEFAULT: u32 = 2u32
Available on crate feature encoder only.
pub const PB_DEFAULT: u32 = 2u32
encoder only.Default number of position bits.
Sourcepub const NICE_LEN_MAX: u32 = 273u32
Available on crate feature encoder only.
pub const NICE_LEN_MAX: u32 = 273u32
encoder only.Maximum match finder nice length.
Sourcepub const NICE_LEN_MIN: u32 = 8u32
Available on crate feature encoder only.
pub const NICE_LEN_MIN: u32 = 8u32
encoder only.Minimum match finder nice length.
Sourcepub const DICT_SIZE_DEFAULT: u32 = 8_388_608u32
Available on crate feature encoder only.
pub const DICT_SIZE_DEFAULT: u32 = 8_388_608u32
encoder only.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
Available on crate feature encoder only.
pub fn new( dict_size: u32, lc: u32, lp: u32, pb: u32, mode: EncodeMode, nice_len: u32, mf: MfType, depth_limit: i32, ) -> Self
encoder only.Creates new LZMA encoding options with specified parameters.
Sourcepub fn with_preset(preset: u32) -> Self
Available on crate feature encoder only.
pub fn with_preset(preset: u32) -> Self
encoder only.preset: [0..9]
Sourcepub fn set_preset(&mut self, preset: u32)
Available on crate feature encoder only.
pub fn set_preset(&mut self, preset: u32)
encoder only.preset: [0..9]
Sourcepub fn get_memory_usage(&self) -> u32
Available on crate feature encoder only.
pub fn get_memory_usage(&self) -> u32
encoder only.Returns the estimated memory usage in kilobytes for these options.
Trait Implementations§
Source§impl Clone for LzmaOptions
Available on crate feature encoder only.
impl Clone for LzmaOptions
Available on crate feature
encoder only.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
Available on crate feature encoder only.
impl Debug for LzmaOptions
Available on crate feature
encoder only.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