Enum actix_web::http::ContentEncoding [−][src]
#[non_exhaustive]
pub enum ContentEncoding {
Auto,
Br,
Deflate,
Gzip,
Zstd,
Identity,
}Expand description
Represents a supported content encoding.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Automatically select encoding based on encoding negotiation.
A format using the Brotli algorithm.
A format using the zlib structure with deflate algorithm.
Gzip algorithm.
Indicates the identity function (i.e. no compression, nor modification).
Implementations
Trait Implementations
Returns the “default value” for a type. Read more
Returns the name of the header field
Parse a header
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 IntoHeaderValue>::Error>
pub fn try_into_value(
self
) -> Result<HeaderValue, <ContentEncoding as IntoHeaderValue>::Error>
Try to convert value to a HeaderValue.
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.
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
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Error = <T as IntoHeaderValue>::Error
pub fn try_into_header_pair(
self
) -> Result<(HeaderName, HeaderValue), <T as IntoHeaderPair>::Error>
type Output = T
type Output = T
Should always be Self