Enum ajars_actix_web::actix_web::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
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 · sourcefn 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
type Err = ContentEncodingParseError
type Err = ContentEncodingParseError
The associated error which can be returned from parsing.
fn from_str(
enc: &str
) -> Result<ContentEncoding, <ContentEncoding as FromStr>::Err>
fn from_str(
enc: &str
) -> Result<ContentEncoding, <ContentEncoding as FromStr>::Err>
Parses a string s
to return a value of this type. Read more
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<ContentEncoding> for ContentEncoding
impl PartialEq<ContentEncoding> for ContentEncoding
impl<'_> TryFrom<&'_ str> for ContentEncoding
impl<'_> TryFrom<&'_ str> for ContentEncoding
type Error = ContentEncodingParseError
type Error = ContentEncodingParseError
The type returned in the event of a conversion error.
fn try_from(
val: &str
) -> Result<ContentEncoding, <ContentEncoding as TryFrom<&'_ str>>::Error>
fn try_from(
val: &str
) -> Result<ContentEncoding, <ContentEncoding as TryFrom<&'_ str>>::Error>
Performs the conversion.
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 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> TryIntoHeaderPair for T where
T: Header,
impl<T> TryIntoHeaderPair for T where
T: Header,
type Error = <T as TryIntoHeaderValue>::Error
fn try_into_pair(
self
) -> Result<(HeaderName, HeaderValue), <T as TryIntoHeaderPair>::Error>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more