pub struct Compression(/* private fields */);
Expand description
When compressing data, the compression level can be specified by a value in this enum.
Implementations§
Source§impl Compression
impl Compression
Sourcepub const fn new(level: u32) -> Compression
pub const fn new(level: u32) -> Compression
Create a new compression spec with a specific numeric level in the range 1..=9
.
§Panics
A level outside of the 1..=9
range will throw a panic. Use Self::try_new
to
gracefully handle invalid levels (e.g. from user input).
Sourcepub const fn try_new(level: u32) -> Option<Compression>
pub const fn try_new(level: u32) -> Option<Compression>
Create a new compression spec with a specific numeric level in the range 1..=9
.
Sourcepub fn none() -> Compression
👎Deprecated since 0.5.1: libbz2 does not support compression level 0
pub fn none() -> Compression
Do not compress.
Sourcepub const fn fast() -> Compression
pub const fn fast() -> Compression
Optimize for the best speed of encoding.
Sourcepub const fn best() -> Compression
pub const fn best() -> Compression
Optimize for smallest output size.
Trait Implementations§
Source§impl Clone for Compression
impl Clone for Compression
Source§fn clone(&self) -> Compression
fn clone(&self) -> Compression
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 Compression
impl Debug for Compression
Source§impl Default for Compression
impl Default for Compression
Source§fn default() -> Compression
fn default() -> Compression
Choose the default compression, a balance between speed and size.
Source§impl PartialEq for Compression
impl PartialEq for Compression
impl Copy for Compression
impl Eq for Compression
impl StructuralPartialEq for Compression
Auto Trait Implementations§
impl Freeze for Compression
impl RefUnwindSafe for Compression
impl Send for Compression
impl Sync for Compression
impl Unpin for Compression
impl UnwindSafe for Compression
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