Struct GzipCompressionLevel

Source
pub struct GzipCompressionLevel(u8);
Expand description

Compression level for gzip compression.

Tuple Fields§

§0: u8

Implementations§

Source§

impl GzipCompressionLevel

Source

pub fn new(level: u8) -> Result<Self, Error>

Creates a new GzipCompressionLevel from a u8.

The level must be in the range of GzipCompressionLevel::min and GzipCompressionLevel::max.

§Errors

Returns an error if the value is not in the range of GzipCompressionLevel::min and GzipCompressionLevel::max.

Source

pub const fn default_level() -> u8

Returns the default level (6) for GzipCompressionLevel.

The default level adheres to the one selected by the gzip executable.

Source

pub const fn min() -> u8

Returns the minimum allowed level (1) for GzipCompressionLevel.

Source

pub const fn max() -> u8

Returns the maximum allowed level (9) for GzipCompressionLevel.

Trait Implementations§

Source§

impl Clone for GzipCompressionLevel

Source§

fn clone(&self) -> GzipCompressionLevel

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GzipCompressionLevel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GzipCompressionLevel

Source§

fn default() -> Self

Returns the default GzipCompressionLevel.

Delegates to GzipCompressionLevel::default_level for retrieving the default compression level.

Source§

impl Display for GzipCompressionLevel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&GzipCompressionLevel> for i32

Source§

fn from(value: &GzipCompressionLevel) -> Self

Converts to this type from the input type.
Source§

impl From<&GzipCompressionLevel> for u32

Source§

fn from(value: &GzipCompressionLevel) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for GzipCompressionLevel

Source§

fn eq(&self, other: &GzipCompressionLevel) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<i16> for GzipCompressionLevel

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: i16) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<i32> for GzipCompressionLevel

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: i32) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<i64> for GzipCompressionLevel

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: i64) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<i8> for GzipCompressionLevel

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: i8) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<u16> for GzipCompressionLevel

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: u16) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<u32> for GzipCompressionLevel

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: u32) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<u64> for GzipCompressionLevel

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: u64) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<u8> for GzipCompressionLevel

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: u8) -> Result<Self, Error>

Performs the conversion.
Source§

impl Eq for GzipCompressionLevel

Source§

impl StructuralPartialEq for GzipCompressionLevel

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> ErasedDestructor for T
where T: 'static,