Enum actix_web::http::header::ContentEncoding
source · 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§fn default() -> ContentEncoding
fn default() -> ContentEncoding
Returns the “default value” for a type. Read more
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>(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.
source§impl PartialEq<ContentEncoding> for ContentEncoding
impl PartialEq<ContentEncoding> for ContentEncoding
source§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 ==
.source§impl TryFrom<&str> for ContentEncoding
impl TryFrom<&str> for ContentEncoding
source§impl TryIntoHeaderValue for ContentEncoding
impl TryIntoHeaderValue for ContentEncoding
§type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
The type returned in the event of a conversion error.
source§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 StructuralEq for ContentEncoding
impl StructuralPartialEq for ContentEncoding
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§
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> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere T: Hash + ?Sized,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.