Enum distant_net::common::CompressionCodec
source · pub enum CompressionCodec {
Deflate {
level: CompressionLevel,
},
Gzip {
level: CompressionLevel,
},
Zlib {
level: CompressionLevel,
},
}Expand description
Represents a codec that applies compression during encoding and decompression during decoding of a frame’s item
Variants
Deflate
Fields
level: CompressionLevelApply DEFLATE compression/decompression using compression level
Gzip
Fields
level: CompressionLevelApply gzip compression/decompression using compression level
Zlib
Fields
level: CompressionLevelApply zlib compression/decompression using compression level
Implementations
sourceimpl CompressionCodec
impl CompressionCodec
sourcepub fn from_type_and_level(
ty: CompressionType,
level: CompressionLevel
) -> Result<CompressionCodec>
pub fn from_type_and_level(
ty: CompressionType,
level: CompressionLevel
) -> Result<CompressionCodec>
Makes a new CompressionCodec based on the CompressionType and CompressionLevel,
returning error if the type is unknown
sourcepub fn deflate(level: impl Into<CompressionLevel>) -> Self
pub fn deflate(level: impl Into<CompressionLevel>) -> Self
Create a new deflate compression codec with the specified level
sourcepub fn gzip(level: impl Into<CompressionLevel>) -> Self
pub fn gzip(level: impl Into<CompressionLevel>) -> Self
Create a new gzip compression codec with the specified level
sourcepub fn zlib(level: impl Into<CompressionLevel>) -> Self
pub fn zlib(level: impl Into<CompressionLevel>) -> Self
Create a new zlib compression codec with the specified level
sourcepub fn level(&self) -> CompressionLevel
pub fn level(&self) -> CompressionLevel
Returns the compression level associated with the codec
sourcepub fn ty(&self) -> CompressionType
pub fn ty(&self) -> CompressionType
Returns the compression type associated with the codec
Trait Implementations
sourceimpl Clone for CompressionCodec
impl Clone for CompressionCodec
sourcefn clone(&self) -> CompressionCodec
fn clone(&self) -> CompressionCodec
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Codec for CompressionCodec
impl Codec for CompressionCodec
sourceimpl Debug for CompressionCodec
impl Debug for CompressionCodec
sourceimpl PartialEq<CompressionCodec> for CompressionCodec
impl PartialEq<CompressionCodec> for CompressionCodec
sourcefn eq(&self, other: &CompressionCodec) -> bool
fn eq(&self, other: &CompressionCodec) -> bool
impl Copy for CompressionCodec
impl Eq for CompressionCodec
impl StructuralEq for CompressionCodec
impl StructuralPartialEq for CompressionCodec
Auto Trait Implementations
impl RefUnwindSafe for CompressionCodec
impl Send for CompressionCodec
impl Sync for CompressionCodec
impl Unpin for CompressionCodec
impl UnwindSafe for CompressionCodec
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more