Struct typed_headers::ContentEncoding[][src]

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.

ABNF

Content-Encoding = 1#content-coding

Example values

  • gzip

Methods

impl ContentEncoding
[src]

Methods from Deref<Target = Vec<ContentCoding>>

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

Examples

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

Important traits for &'a [u8]

Extracts a slice containing the entire vector.

Equivalent to &s[..].

Examples

use std::io::{self, Write};
let buffer = vec![1, 2, 3, 5, 8];
io::sink().write(buffer.as_slice()).unwrap();

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

Examples

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

Returns true if the vector contains no elements.

Examples

let mut v = Vec::new();
assert!(v.is_empty());

v.push(1);
assert!(!v.is_empty());

Trait Implementations

impl Clone for ContentEncoding
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for ContentEncoding
[src]

Formats the value using the given formatter. Read more

impl PartialEq for ContentEncoding
[src]

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

This method tests for !=.

impl Deref for ContentEncoding
[src]

The resulting type after dereferencing.

Important traits for Vec<u8>

Dereferences the value.

impl Header for ContentEncoding
[src]

Returns the name of this header. Read more

Parses the header from the raw value bytes. Read more

Serializes the header to raw values. Read more

impl From<ContentCoding> for ContentEncoding
[src]

Performs the conversion.

Auto Trait Implementations