Struct http_types::transfer::TransferEncoding[][src]

pub struct TransferEncoding { /* fields omitted */ }

The form of encoding used to safely transfer the payload body to the user.

MDN Documentation

Specifications

Examples

use http_types::Response;
use http_types::transfer::{TransferEncoding, Encoding};
let mut encoding = TransferEncoding::new(Encoding::Chunked);

let mut res = Response::new(200);
encoding.apply(&mut res);

let encoding = TransferEncoding::from_headers(res)?.unwrap();
assert_eq!(encoding, &Encoding::Chunked);

Implementations

impl TransferEncoding[src]

pub fn new(encoding: Encoding) -> Self[src]

Create a new instance of CacheControl.

pub fn from_headers(headers: impl AsRef<Headers>) -> Result<Option<Self>>[src]

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 TransferEncoding[src]

impl Deref for TransferEncoding[src]

type Target = Encoding

The resulting type after dereferencing.

impl DerefMut for TransferEncoding[src]

impl From<&'_ Encoding> for TransferEncoding[src]

impl From<&'_ EncodingProposal> for TransferEncoding[src]

impl From<Encoding> for TransferEncoding[src]

impl From<EncodingProposal> for TransferEncoding[src]

impl PartialEq<&'_ Encoding> for TransferEncoding[src]

impl PartialEq<Encoding> for TransferEncoding[src]

impl ToHeaderValues for TransferEncoding[src]

type Iter = IntoIter<HeaderValue>

Returned iterator over header values which this type may correspond to.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,