[][src]Struct typed_headers::ContentEncoding

pub struct ContentEncoding(_);

Content-Encoding header, defined in RFC7231

The Content-Encoding header field indicates what content codings have been applied to the representation, beyond those inherent in the media type, and thus what decoding mechanisms have to be applied in order to obtain data in the media type referenced by the Content-Type header field. Content-Encoding is primarily used to allow a representation's data to be compressed without losing the identity of its underlying media type.


Content-Encoding = 1#content-coding

Example values

  • gzip


impl ContentEncoding[src]

Methods from Deref<Target = Vec<ContentCoding>>

pub fn capacity(&self) -> usize

Returns the number of elements the vector can hold without reallocating.


let vec: Vec<i32> = Vec::with_capacity(10);
assert_eq!(vec.capacity(), 10);

pub fn as_slice(&self) -> &[T]

Extracts a slice containing the entire vector.

Equivalent to &s[..].


use std::io::{self, Write};
let buffer = vec![1, 2, 3, 5, 8];

pub fn len(&self) -> usize

Returns the number of elements in the vector, also referred to as its 'length'.


let a = vec![1, 2, 3];
assert_eq!(a.len(), 3);

pub fn is_empty(&self) -> bool

Returns true if the vector contains no elements.


let mut v = Vec::new();


Trait Implementations

impl Header for ContentEncoding[src]

impl Clone for ContentEncoding[src]

default fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

impl PartialEq<ContentEncoding> for ContentEncoding[src]

impl From<ContentCoding> for ContentEncoding[src]

impl Debug for ContentEncoding[src]

impl Deref for ContentEncoding[src]

type Target = Vec<ContentCoding>

The resulting type after dereferencing.

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized

impl<T> BorrowMut for T where
    T: ?Sized

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.

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