Enum awc::http::header::ContentEncoding
#[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§
§impl ContentEncoding
impl ContentEncoding
pub const fn to_header_value(self) -> HeaderValue
pub const fn to_header_value(self) -> HeaderValue
Convert content encoding to header value.
Trait Implementations§
§impl Clone for ContentEncoding
impl Clone for ContentEncoding
§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 more§impl Debug for ContentEncoding
impl Debug for ContentEncoding
§impl Default for ContentEncoding
impl Default for ContentEncoding
§fn default() -> ContentEncoding
fn default() -> ContentEncoding
Returns the “default value” for a type. Read more
§impl FromStr for ContentEncoding
impl FromStr for ContentEncoding
§impl Hash for ContentEncoding
impl Hash for ContentEncoding
§impl Header for ContentEncoding
impl Header for ContentEncoding
§fn name() -> HeaderName
fn name() -> HeaderName
Returns the name of the header field.
§fn parse<T>(msg: &T) -> Result<ContentEncoding, ParseError>where
T: HttpMessage,
fn parse<T>(msg: &T) -> Result<ContentEncoding, ParseError>where
T: HttpMessage,
Parse the header from a HTTP message.
§impl PartialEq for ContentEncoding
impl PartialEq for ContentEncoding
§fn eq(&self, other: &ContentEncoding) -> bool
fn eq(&self, other: &ContentEncoding) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl TryFrom<&str> for ContentEncoding
impl TryFrom<&str> for ContentEncoding
§impl TryIntoHeaderValue for ContentEncoding
impl TryIntoHeaderValue for ContentEncoding
§type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
The type returned in the event of a conversion error.
§fn try_into_value(
self
) -> Result<HeaderValue, <ContentEncoding as TryIntoHeaderValue>::Error>
fn try_into_value( self ) -> Result<HeaderValue, <ContentEncoding as TryIntoHeaderValue>::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
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key
and return true
if they are equal.