pub struct CompressionProfiler {
pub default_profile: CompressionProfile,
}Expand description
Auto-select compression profiles based on file paths
Fields§
§default_profile: CompressionProfileDefault profile when no pattern matches
Implementations§
Source§impl CompressionProfiler
impl CompressionProfiler
Sourcepub fn with_default(default: CompressionProfile) -> CompressionProfiler
pub fn with_default(default: CompressionProfile) -> CompressionProfiler
Create a profiler with a custom default
Sourcepub fn for_path(&self, path: &str) -> CompressionProfile
pub fn for_path(&self, path: &str) -> CompressionProfile
Select compression profile based on file path
Sourcepub fn by_name(&self, name: &str) -> Option<CompressionProfile>
pub fn by_name(&self, name: &str) -> Option<CompressionProfile>
Get profile by name
Sourcepub fn estimate_compressed_size(
&self,
path: &str,
original_size: usize,
) -> usize
pub fn estimate_compressed_size( &self, path: &str, original_size: usize, ) -> usize
Estimate compressed size for planning
Trait Implementations§
Source§impl Clone for CompressionProfiler
impl Clone for CompressionProfiler
Source§fn clone(&self) -> CompressionProfiler
fn clone(&self) -> CompressionProfiler
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 CompressionProfiler
impl Debug for CompressionProfiler
Source§impl Default for CompressionProfiler
impl Default for CompressionProfiler
Source§fn default() -> CompressionProfiler
fn default() -> CompressionProfiler
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CompressionProfiler
impl RefUnwindSafe for CompressionProfiler
impl Send for CompressionProfiler
impl Sync for CompressionProfiler
impl Unpin for CompressionProfiler
impl UnwindSafe for CompressionProfiler
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