#[non_exhaustive]pub enum Coding {
Gzip,
Deflate,
Brotli,
Zstd,
Other(String),
}Expand description
A content coding.
The four this crate decodes, and Other for any token it does not. Marked
non-exhaustive: a coding that becomes standard should not be a breaking change here.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Gzip
Deflate
In its zlib-wrapped form (RFC 1950), like browsers.
Brotli
Zstd
Other(String)
A coding named on the wire that this crate does not decode, lowercased.
Includes identity, which means the absence of a coding rather than one to apply.
Implementations§
Source§impl Coding
impl Coding
Sourcepub fn from_option(value: &str) -> Option<Self>
pub fn from_option(value: &str) -> Option<Self>
Match the compress option’s value, given as a coding’s wire token.
Matches the four documented tokens exactly. Self::from_token reads off the wire and so
takes a token as loosely as HTTP writes it.
Sourcepub fn from_token(token: &str) -> Self
pub fn from_token(token: &str) -> Self
Read a content-coding token, case-insensitively.
Anything this crate does not decode, identity included, becomes
Other; see is_supported.
Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Whether this crate can decode this coding.