pub struct CodecTunables {
pub quality: u8,
pub zstd_quality: u8,
pub xz_level: u8,
pub ppmd_order: u8,
pub ppmd7_budget: usize,
pub ppmd8_budget: usize,
pub bzip2_block_kb: u32,
pub lzma_dict_mb: u32,
}Expand description
Codec-agnostic tunables. Every codec reads only the fields it
understands; the rest are ignored. The struct is the
single source of truth for “what knobs does the writer want to
turn” — adding a new knob is one field here, not a new
compress_with_* function per codec (OCP).
Fields§
§quality: u8Brotli quality (0..=11). Codecs without a quality parameter ignore this. Historically this also served as a ZSTD level proxy — decoupled below since the two scales diverged (omnizip 0.21.12+ runs the optimal parser at every zstd level >= L3, so brotli’s default q11 was silently pushing zstd into the slow band).
zstd_quality: u8ZSTD quality (0..=22 via level_for_quality). 0 = fast-tier
default. Independent of quality (brotli) by design.
xz_level: u8XZ preset (0..=9). 0 = preset 6 (xz’s balanced default).
Independent of quality (brotli) — see zstd_quality.
ppmd_order: u8PPMd7 / PPMd8 context-model order (1..=16).
ppmd7_budget: usizePPMd7 context-tree memory budget in bytes. 0 = codec default.
ppmd8_budget: usizePPMd8 context-tree memory budget in bytes. 0 = codec default.
bzip2_block_kb: u32BZip2 block size in KB (100..=900). Maps to level 1..=9.
lzma_dict_mb: u32LZMA dictionary size in MB. Reserved — no pure-Rust LZMA encoder exists yet; field is here so profiles can declare intent and we wire it when omnizip-lzma ships an encoder.
Implementations§
Source§impl CodecTunables
impl CodecTunables
Sourcepub fn from_quality(quality: u8) -> Self
pub fn from_quality(quality: u8) -> Self
Build tunables carrying only quality. Codecs that don’t
override compress_with_tunables see no difference from
compress(plaintext).
Trait Implementations§
Source§impl Clone for CodecTunables
impl Clone for CodecTunables
Source§fn clone(&self) -> CodecTunables
fn clone(&self) -> CodecTunables
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CodecTunables
impl Debug for CodecTunables
Auto Trait Implementations§
impl Freeze for CodecTunables
impl RefUnwindSafe for CodecTunables
impl Send for CodecTunables
impl Sync for CodecTunables
impl Unpin for CodecTunables
impl UnsafeUnpin for CodecTunables
impl UnwindSafe for CodecTunables
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more