pub struct CompressionConfig {
pub default_algorithm: CompressionAlgorithm,
pub default_level: CompressionLevel,
pub strategy: CompressionStrategy,
pub algorithm_overrides: HashMap<ResourceType, CompressionAlgorithm>,
pub min_size_threshold: usize,
pub max_memory_size: usize,
pub parallel_compression: bool,
}Expand description
Compression configuration
Fields§
§default_algorithm: CompressionAlgorithmDefault algorithm to use
default_level: CompressionLevelDefault compression level
strategy: CompressionStrategyCompression strategy
algorithm_overrides: HashMap<ResourceType, CompressionAlgorithm>Per-resource-type algorithm overrides
min_size_threshold: usizeMinimum size threshold for compression (bytes)
max_memory_size: usizeMaximum size for in-memory compression
parallel_compression: boolEnable parallel compression for large resources
Implementations§
Source§impl CompressionConfig
impl CompressionConfig
Sourcepub fn with_algorithm(self, algorithm: CompressionAlgorithm) -> Self
pub fn with_algorithm(self, algorithm: CompressionAlgorithm) -> Self
Set default algorithm
Sourcepub fn with_level(self, level: CompressionLevel) -> Self
pub fn with_level(self, level: CompressionLevel) -> Self
Set default compression level
Sourcepub fn with_strategy(self, strategy: CompressionStrategy) -> Self
pub fn with_strategy(self, strategy: CompressionStrategy) -> Self
Set compression strategy
Sourcepub fn with_min_threshold(self, threshold: usize) -> Self
pub fn with_min_threshold(self, threshold: usize) -> Self
Set minimum size threshold
Sourcepub fn with_parallel(self, parallel: bool) -> Self
pub fn with_parallel(self, parallel: bool) -> Self
Enable/disable parallel compression
Sourcepub fn algorithm_for_resource(
&self,
resource_type: ResourceType,
) -> CompressionAlgorithm
pub fn algorithm_for_resource( &self, resource_type: ResourceType, ) -> CompressionAlgorithm
Get algorithm for resource type
Sourcepub fn level_for_strategy(
&self,
strategy: CompressionStrategy,
) -> CompressionLevel
pub fn level_for_strategy( &self, strategy: CompressionStrategy, ) -> CompressionLevel
Get compression level adjusted for strategy
Trait Implementations§
Source§impl Clone for CompressionConfig
impl Clone for CompressionConfig
Source§fn clone(&self) -> CompressionConfig
fn clone(&self) -> CompressionConfig
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 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> 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