Struct http_types::content::ContentEncoding[][src]

pub struct ContentEncoding { /* fields omitted */ }
Expand description

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

Create a new instance of CacheControl.

Create a new instance from headers.

Sets the Content-Encoding header.

Get the HeaderName.

Get the HeaderValue.

Access the encoding kind.

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Converts this object to an iterator of resolved HeaderValues.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.