pub struct ZstdCompressionLevel(u8);
Expand description
Compression level for zstd compression.
Tuple Fields§
§0: u8
Implementations§
Source§impl ZstdCompressionLevel
impl ZstdCompressionLevel
Sourcepub fn new(level: u8) -> Result<Self, Error>
pub fn new(level: u8) -> Result<Self, Error>
Creates a new ZstdCompressionLevel
from a u8
.
The level
must be in the range of ZstdCompressionLevel::min
and ZstdCompressionLevel::max
.
§Errors
Returns an error if the value is not in the range of ZstdCompressionLevel::min
and ZstdCompressionLevel::max
.
Sourcepub const fn default_level() -> u8
pub const fn default_level() -> u8
Returns the default level (3
) for ZstdCompressionLevel
.
The default level adheres to the one selected by the zstd executable.
Sourcepub const fn min() -> u8
pub const fn min() -> u8
Returns the minimum allowed level (0
) for ZstdCompressionLevel
.
Sourcepub const fn max() -> u8
pub const fn max() -> u8
Returns the maximum allowed level (22
) for ZstdCompressionLevel
.
Trait Implementations§
Source§impl Clone for ZstdCompressionLevel
impl Clone for ZstdCompressionLevel
Source§fn clone(&self) -> ZstdCompressionLevel
fn clone(&self) -> ZstdCompressionLevel
Returns a copy 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 ZstdCompressionLevel
impl Debug for ZstdCompressionLevel
Source§impl Default for ZstdCompressionLevel
impl Default for ZstdCompressionLevel
Source§fn default() -> Self
fn default() -> Self
Returns the default ZstdCompressionLevel
.
Delegates to ZstdCompressionLevel::default_level
for retrieving the default compression level.
Source§impl Display for ZstdCompressionLevel
impl Display for ZstdCompressionLevel
Source§impl From<&ZstdCompressionLevel> for i32
impl From<&ZstdCompressionLevel> for i32
Source§fn from(value: &ZstdCompressionLevel) -> Self
fn from(value: &ZstdCompressionLevel) -> Self
Converts to this type from the input type.
Source§impl From<&ZstdCompressionLevel> for u32
impl From<&ZstdCompressionLevel> for u32
Source§fn from(value: &ZstdCompressionLevel) -> Self
fn from(value: &ZstdCompressionLevel) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ZstdCompressionLevel
impl PartialEq for ZstdCompressionLevel
Source§impl TryFrom<i16> for ZstdCompressionLevel
impl TryFrom<i16> for ZstdCompressionLevel
Source§impl TryFrom<i32> for ZstdCompressionLevel
impl TryFrom<i32> for ZstdCompressionLevel
Source§impl TryFrom<i64> for ZstdCompressionLevel
impl TryFrom<i64> for ZstdCompressionLevel
Source§impl TryFrom<i8> for ZstdCompressionLevel
impl TryFrom<i8> for ZstdCompressionLevel
Source§impl TryFrom<u16> for ZstdCompressionLevel
impl TryFrom<u16> for ZstdCompressionLevel
Source§impl TryFrom<u32> for ZstdCompressionLevel
impl TryFrom<u32> for ZstdCompressionLevel
Source§impl TryFrom<u64> for ZstdCompressionLevel
impl TryFrom<u64> for ZstdCompressionLevel
Source§impl TryFrom<u8> for ZstdCompressionLevel
impl TryFrom<u8> for ZstdCompressionLevel
impl Eq for ZstdCompressionLevel
impl StructuralPartialEq for ZstdCompressionLevel
Auto Trait Implementations§
impl Freeze for ZstdCompressionLevel
impl RefUnwindSafe for ZstdCompressionLevel
impl Send for ZstdCompressionLevel
impl Sync for ZstdCompressionLevel
impl Unpin for ZstdCompressionLevel
impl UnwindSafe for ZstdCompressionLevel
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