pub struct ContentEncoding { /* private fields */ }
Expand description
Specify the compression algorithm.
§Specifications
§Examples
use http_types_rs::Response;
use http_types_rs::content::{ContentEncoding, Encoding};
let mut encoding = ContentEncoding::new(Encoding::Gzip);
let mut res = Response::new(200);
res.insert_header(&encoding, &encoding);
let encoding = ContentEncoding::from_headers(res)?.unwrap();
assert_eq!(encoding, &Encoding::Gzip);
Implementations§
Trait Implementations§
Source§impl Debug for ContentEncoding
impl Debug for ContentEncoding
Source§impl Deref for ContentEncoding
impl Deref for ContentEncoding
Source§impl DerefMut for ContentEncoding
impl DerefMut for ContentEncoding
Source§impl From<&Encoding> for ContentEncoding
impl From<&Encoding> for ContentEncoding
Source§impl From<&EncodingProposal> for ContentEncoding
impl From<&EncodingProposal> for ContentEncoding
Source§fn from(encoding: &EncodingProposal) -> Self
fn from(encoding: &EncodingProposal) -> Self
Converts to this type from the input type.
Source§impl From<Encoding> for ContentEncoding
impl From<Encoding> for ContentEncoding
Source§impl From<EncodingProposal> for ContentEncoding
impl From<EncodingProposal> for ContentEncoding
Source§fn from(encoding: EncodingProposal) -> Self
fn from(encoding: EncodingProposal) -> Self
Converts to this type from the input type.
Source§impl Header for ContentEncoding
impl Header for ContentEncoding
Source§fn header_name(&self) -> HeaderName
fn header_name(&self) -> HeaderName
Access the header’s name.
Source§fn header_value(&self) -> HeaderValue
fn header_value(&self) -> HeaderValue
Access the header’s value.
Source§impl PartialEq<&Encoding> for ContentEncoding
impl PartialEq<&Encoding> for ContentEncoding
Source§impl PartialEq<Encoding> for ContentEncoding
impl PartialEq<Encoding> 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> ToHeaderValues for Twhere
T: Header,
impl<T> ToHeaderValues for Twhere
T: Header,
Source§type Iter = IntoIter<HeaderValue>
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
Source§fn to_header_values(&self) -> Result<<T as ToHeaderValues>::Iter, Error>
fn to_header_values(&self) -> Result<<T as ToHeaderValues>::Iter, Error>
Converts this object to an iterator of resolved
HeaderValues
.