pub enum HttpEncoding {
Identity,
Deflate,
Gzip,
Br,
Zstd,
}Expand description
Http content encoding for both incoming and outgoing web requests.
Variants§
Identity
Identity function without no compression.
This is the default encoding and does not require the presence of the content-encoding
HTTP header.
Deflate
Gzip
A format using the Lempel-Ziv coding (LZ77), with a 32-bit CRC.
This is the original format of the UNIX gzip program. The HTTP/1.1 standard also recommends
that the servers supporting this content-encoding should recognize x-gzip as an alias, for
compatibility purposes.
Br
A format using the Brotli algorithm.
Zstd
A format using the Zstd compression algorithm.
Implementations§
Source§impl HttpEncoding
impl HttpEncoding
Sourcepub fn parse(str: &str) -> Self
pub fn parse(str: &str) -> Self
Parses a HttpEncoding from its content-encoding header value.
Accepts aliases, whitespace, and mixed case; unknown values fall back to identity.
Use Self::parse_strict when validating an incoming request header.
Sourcepub fn parse_strict(value: &str) -> Option<Self>
pub fn parse_strict(value: &str) -> Option<Self>
Parses a canonical Content-Encoding value, returning None for unsupported values.
Trait Implementations§
Source§impl Clone for HttpEncoding
impl Clone for HttpEncoding
impl Copy for HttpEncoding
Source§impl Debug for HttpEncoding
impl Debug for HttpEncoding
Source§impl Default for HttpEncoding
impl Default for HttpEncoding
Source§impl<'de> Deserialize<'de> for HttpEncoding
impl<'de> Deserialize<'de> for HttpEncoding
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for HttpEncoding
Source§impl PartialEq for HttpEncoding
impl PartialEq for HttpEncoding
Source§impl Serialize for HttpEncoding
impl Serialize for HttpEncoding
impl StructuralPartialEq for HttpEncoding
Auto Trait Implementations§
impl Freeze for HttpEncoding
impl RefUnwindSafe for HttpEncoding
impl Send for HttpEncoding
impl Sync for HttpEncoding
impl Unpin for HttpEncoding
impl UnsafeUnpin for HttpEncoding
impl UnwindSafe for HttpEncoding
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more