#[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
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.
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§
source§impl ContentEncoding
impl ContentEncoding
sourcepub const fn to_header_value(self) -> HeaderValue
pub const fn to_header_value(self) -> HeaderValue
Convert content encoding to header value.
Trait Implementations§
source§impl Clone for ContentEncoding
impl Clone for ContentEncoding
source§fn clone(&self) -> ContentEncoding
fn clone(&self) -> ContentEncoding
Returns a copy 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 ContentEncoding
impl Debug for ContentEncoding
source§impl Default for ContentEncoding
impl Default for ContentEncoding
source§impl FromStr for ContentEncoding
impl FromStr for ContentEncoding
source§impl Hash for ContentEncoding
impl Hash for ContentEncoding
source§impl Header for ContentEncoding
impl Header for ContentEncoding
source§fn name() -> HeaderName
fn name() -> HeaderName
Returns the name of the header field.
source§fn parse<T: HttpMessage>(msg: &T) -> Result<Self, ParseError>
fn parse<T: HttpMessage>(msg: &T) -> Result<Self, ParseError>
Parse the header from a HTTP message.
source§impl PartialEq for ContentEncoding
impl PartialEq for ContentEncoding
source§impl TryFrom<&str> for ContentEncoding
impl TryFrom<&str> for ContentEncoding
source§impl TryIntoHeaderValue for ContentEncoding
impl TryIntoHeaderValue for ContentEncoding
source§type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
The type returned in the event of a conversion error.
source§fn try_into_value(self) -> Result<HeaderValue, Self::Error>
fn try_into_value(self) -> Result<HeaderValue, Self::Error>
Try to convert value to a HeaderValue.
impl Copy for ContentEncoding
impl Eq for ContentEncoding
impl StructuralPartialEq for ContentEncoding
Auto Trait Implementations§
impl Freeze for ContentEncoding
impl RefUnwindSafe for ContentEncoding
impl Send for ContentEncoding
impl Sync for ContentEncoding
impl Unpin for ContentEncoding
impl UnwindSafe for ContentEncoding
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.