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
Apply DEFLATE compression/decompression using compression level
Fields
§
level: CompressionLevel
Gzip
Apply gzip compression/decompression using compression level
Fields
§
level: CompressionLevel
Zlib
Apply zlib compression/decompression using compression level
Fields
§
level: CompressionLevel
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 for CompressionCodec
impl PartialEq for CompressionCodec
impl Copy for CompressionCodec
impl Eq for CompressionCodec
impl StructuralPartialEq for CompressionCodec
Auto Trait Implementations§
impl Freeze for CompressionCodec
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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