pub enum CompressionEncoding {
Identity,
Gzip,
}Expand description
Supported compression encodings.
This enum is used for header parsing and negotiation.
Use resolve_codec to get the actual codec implementation.
Variants§
Implementations§
Source§impl CompressionEncoding
impl CompressionEncoding
Sourcepub fn from_header(value: Option<&str>) -> Option<Self>
pub fn from_header(value: Option<&str>) -> Option<Self>
Parse from Content-Encoding or Connect-Content-Encoding header value. Returns None for unsupported encodings (caller should return Unimplemented).
Sourcepub fn codec(&self) -> Option<BoxedCodec>
pub fn codec(&self) -> Option<BoxedCodec>
Get the codec for this encoding.
Returns None for identity, Some(BoxedCodec) for others.
Sourcepub fn codec_with_level(&self, level: CompressionLevel) -> Option<BoxedCodec>
pub fn codec_with_level(&self, level: CompressionLevel) -> Option<BoxedCodec>
Get the codec for this encoding with the specified compression level.
Returns None for identity, Some(BoxedCodec) for others.
The level is converted to algorithm-specific values matching tower-http behavior.
Trait Implementations§
Source§impl Clone for CompressionEncoding
impl Clone for CompressionEncoding
Source§fn clone(&self) -> CompressionEncoding
fn clone(&self) -> CompressionEncoding
Returns a duplicate 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 CompressionEncoding
impl Debug for CompressionEncoding
Source§impl Default for CompressionEncoding
impl Default for CompressionEncoding
Source§fn default() -> CompressionEncoding
fn default() -> CompressionEncoding
Returns the “default value” for a type. Read more
Source§impl PartialEq for CompressionEncoding
impl PartialEq for CompressionEncoding
impl Copy for CompressionEncoding
impl Eq for CompressionEncoding
impl StructuralPartialEq for CompressionEncoding
Auto Trait Implementations§
impl Freeze for CompressionEncoding
impl RefUnwindSafe for CompressionEncoding
impl Send for CompressionEncoding
impl Sync for CompressionEncoding
impl Unpin for CompressionEncoding
impl UnwindSafe for CompressionEncoding
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.