pub struct CompressionLevel(/* private fields */);Expand description
A validated Zstandard compression level.
Positive levels 1 through 22 select progressively stronger compression. Negative levels select the Zstandard fast strategy, with the absolute value controlling the acceleration step.
Implementations§
Source§impl CompressionLevel
impl CompressionLevel
Sourcepub const UNCOMPRESSED: Self
pub const UNCOMPRESSED: Self
Emit raw blocks without compression.
pub const Uncompressed: Self = Self::UNCOMPRESSED
pub const Fastest: Self = Self::FASTEST
pub const Default: Self = Self::DEFAULT
pub const Better: Self = Self::BETTER
pub const Best: Self = Self::BEST
Sourcepub const MAX_FAST_ACCELERATION: u32
pub const MAX_FAST_ACCELERATION: u32
Largest supported fast-strategy acceleration step.
Sourcepub const fn new(level: u8) -> Result<Self, InvalidCompressionLevel>
pub const fn new(level: u8) -> Result<Self, InvalidCompressionLevel>
Creates a precise positive compression level.
Sourcepub const fn fast(acceleration: u32) -> Result<Self, InvalidCompressionLevel>
pub const fn fast(acceleration: u32) -> Result<Self, InvalidCompressionLevel>
Returns the numeric level used by the compressor parameter table. Creates a fast level with an explicit match-search acceleration step.
Trait Implementations§
Source§impl Clone for CompressionLevel
impl Clone for CompressionLevel
impl Copy for CompressionLevel
Source§impl Debug for CompressionLevel
impl Debug for CompressionLevel
Source§impl Default for CompressionLevel
impl Default for CompressionLevel
impl Eq for CompressionLevel
Source§impl From<CompressionLevel> for i32
impl From<CompressionLevel> for i32
Source§fn from(level: CompressionLevel) -> Self
fn from(level: CompressionLevel) -> Self
Converts to this type from the input type.
Source§impl Hash for CompressionLevel
impl Hash for CompressionLevel
Source§impl Ord for CompressionLevel
impl Ord for CompressionLevel
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for CompressionLevel
impl PartialEq for CompressionLevel
Source§impl PartialOrd for CompressionLevel
impl PartialOrd for CompressionLevel
impl StructuralPartialEq for CompressionLevel
Auto Trait Implementations§
impl Freeze for CompressionLevel
impl RefUnwindSafe for CompressionLevel
impl Send for CompressionLevel
impl Sync for CompressionLevel
impl Unpin for CompressionLevel
impl UnsafeUnpin for CompressionLevel
impl UnwindSafe for CompressionLevel
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