pub struct CompressionLevel(/* private fields */);Expand description
A validated Zstandard compression level.
Levels 1 through 22 select progressively stronger compression. Use the
named constants for common choices and CompressionLevel::new when a
precise level is required.
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 fn new(level: u8) -> Result<Self, InvalidCompressionLevel>
pub const fn new(level: u8) -> Result<Self, InvalidCompressionLevel>
Creates a precise standard compression level.
Trait Implementations§
Source§impl Clone for CompressionLevel
impl Clone for CompressionLevel
Source§fn clone(&self) -> CompressionLevel
fn clone(&self) -> CompressionLevel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl 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
Source§fn cmp(&self, other: &CompressionLevel) -> Ordering
fn cmp(&self, other: &CompressionLevel) -> Ordering
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