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