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§
source§impl 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§
source§impl Clone for CompressionCodec
impl Clone for CompressionCodec
source§fn clone(&self) -> CompressionCodec
fn clone(&self) -> CompressionCodec
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 Codec for CompressionCodec
impl Codec for CompressionCodec
source§impl Debug for CompressionCodec
impl Debug for CompressionCodec
source§impl PartialEq<CompressionCodec> for CompressionCodec
impl PartialEq<CompressionCodec> for CompressionCodec
source§fn eq(&self, other: &CompressionCodec) -> bool
fn eq(&self, other: &CompressionCodec) -> bool
This method tests for
self and other values to be equal, and is used
by ==.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§
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
source§impl<C> CodecExt for Cwhere
C: Codec,
impl<C> CodecExt for Cwhere C: Codec,
source§fn chain<T>(self, codec: T) -> ChainCodec<C, T>
fn chain<T>(self, codec: T) -> ChainCodec<C, T>
Chains this codec with another codec