pub struct CompressionConfig {
pub mode: CompressionMode,
pub algorithm: Algorithm,
pub level: i32,
pub min_gain: f32,
pub probe_bytes: usize,
pub incompressible_extensions: Vec<String>,
pub audio_codec: bool,
}Expand description
Tuning for the compression stage.
Fields§
§mode: CompressionMode§algorithm: Algorithm§level: i32zstd level. Ignored by LZ4. 1..=9 is the useful range for transfers; above ~6 the compressor becomes the bottleneck before the network does.
min_gain: f32In Adaptive mode a chunk is sent raw unless compression saves at least
this fraction. 0.06 means “must shrink by 6% to be worth it”.
probe_bytes: usizeBytes sampled from the head of a chunk for the entropy probe.
incompressible_extensions: Vec<String>Extensions (lowercase, no dot) that skip compression entirely.
audio_codec: boolUse the dedicated lossless coder for uncompressed PCM audio.
zstd manages ~1.05x on .wav, below min_gain, so with this off the
engine ships raw audio untouched. Costs a container-header sniff per
file, and applies only to files that really are PCM.
Trait Implementations§
Source§impl Clone for CompressionConfig
impl Clone for CompressionConfig
Source§impl Debug for CompressionConfig
impl Debug for CompressionConfig
Auto Trait Implementations§
impl Freeze for CompressionConfig
impl RefUnwindSafe for CompressionConfig
impl Send for CompressionConfig
impl Sync for CompressionConfig
impl Unpin for CompressionConfig
impl UnsafeUnpin for CompressionConfig
impl UnwindSafe for CompressionConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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