[−][src]Struct tide::http::content::content_encoding::ContentEncoding
Specify the compression algorithm.
Specifications
Examples
use http_types::Response; use http_types::content::{ContentEncoding, Encoding}; let mut encoding = ContentEncoding::new(Encoding::Gzip); let mut res = Response::new(200); encoding.apply(&mut res); let encoding = ContentEncoding::from_headers(res)?.unwrap(); assert_eq!(encoding, &Encoding::Gzip);
Implementations
impl ContentEncoding
[src]
pub fn new(encoding: Encoding) -> ContentEncoding
[src]
Create a new instance of CacheControl
.
pub fn from_headers(
headers: impl AsRef<Headers>
) -> Result<Option<ContentEncoding>, Error>
[src]
headers: impl AsRef<Headers>
) -> Result<Option<ContentEncoding>, Error>
Create a new instance from headers.
pub fn apply(&self, headers: impl AsMut<Headers>)
[src]
Sets the Content-Encoding
header.
pub fn name(&self) -> HeaderName
[src]
Get the HeaderName
.
pub fn value(&self) -> HeaderValue
[src]
Get the HeaderValue
.
pub fn encoding(&self) -> Encoding
[src]
Access the encoding kind.
Trait Implementations
impl Debug for ContentEncoding
[src]
impl Deref for ContentEncoding
[src]
type Target = Encoding
The resulting type after dereferencing.
pub fn deref(&self) -> &<ContentEncoding as Deref>::Target
[src]
impl DerefMut for ContentEncoding
[src]
pub fn deref_mut(&mut self) -> &mut <ContentEncoding as Deref>::Target
[src]
impl<'_> From<&'_ Encoding> for ContentEncoding
[src]
pub fn from(encoding: &Encoding) -> ContentEncoding
[src]
impl<'_> From<&'_ EncodingProposal> for ContentEncoding
[src]
pub fn from(encoding: &EncodingProposal) -> ContentEncoding
[src]
impl From<Encoding> for ContentEncoding
[src]
pub fn from(encoding: Encoding) -> ContentEncoding
[src]
impl From<EncodingProposal> for ContentEncoding
[src]
pub fn from(encoding: EncodingProposal) -> ContentEncoding
[src]
impl<'_> PartialEq<&'_ Encoding> for ContentEncoding
[src]
pub fn eq(&self, other: &&Encoding) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Encoding> for ContentEncoding
[src]
pub fn eq(&self, other: &Encoding) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl ToHeaderValues for ContentEncoding
[src]
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
pub fn to_header_values(
&self
) -> Result<<ContentEncoding as ToHeaderValues>::Iter, Error>
[src]
&self
) -> Result<<ContentEncoding as ToHeaderValues>::Iter, Error>
Auto Trait Implementations
impl RefUnwindSafe for ContentEncoding
[src]
impl Send for ContentEncoding
[src]
impl Sync for ContentEncoding
[src]
impl Unpin for ContentEncoding
[src]
impl UnwindSafe for ContentEncoding
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,