#[non_exhaustive]
pub enum ContentEncoding {
Identity,
Brotli,
Deflate,
Gzip,
Zstd,
}
Expand description
Represents a supported content encoding.
Includes a commonly-used subset of media types appropriate for use as HTTP content encodings. See IANA HTTP Content Coding Registry.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Identity
Indicates the no-op identity encoding.
I.e., no compression or modification.
Brotli
A format using the Brotli algorithm.
Deflate
A format using the zlib structure with deflate algorithm.
Gzip
Gzip algorithm.
Zstd
Zstd algorithm.
Implementations
Convert content encoding to header value.
Trait Implementations
Returns the “default value” for a type. Read more
Returns the name of the header field.
Parse the header from a HTTP message.
type Error = ContentEncodingParseError
type Error = ContentEncodingParseError
The type returned in the event of a conversion error.
pub fn try_from(
val: &str
) -> Result<ContentEncoding, <ContentEncoding as TryFrom<&'_ str>>::Error>
pub fn try_from(
val: &str
) -> Result<ContentEncoding, <ContentEncoding as TryFrom<&'_ str>>::Error>
Performs the conversion.
type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
The type returned in the event of a conversion error.
pub fn try_into_value(
self
) -> Result<HeaderValue, <ContentEncoding as TryIntoHeaderValue>::Error>
pub fn try_into_value(
self
) -> Result<HeaderValue, <ContentEncoding as TryIntoHeaderValue>::Error>
Try to convert value to a HeaderValue.
Auto Trait Implementations
impl RefUnwindSafe for ContentEncoding
impl Send for ContentEncoding
impl Sync for ContentEncoding
impl Unpin for ContentEncoding
impl UnwindSafe for ContentEncoding
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
type Error = <T as TryIntoHeaderValue>::Error
pub fn try_into_pair(
self
) -> Result<(HeaderName, HeaderValue), <T as TryIntoHeaderPair>::Error>
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more