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]
impl ContentEncoding
pub fn new(values: Vec<ContentCoding>) -> Result<ContentEncoding, Error>
[src]
pub fn new(values: Vec<ContentCoding>) -> Result<ContentEncoding, Error>
Methods from Deref<Target = Vec<ContentCoding>>
pub fn capacity(&self) -> usize
1.0.0[src]
pub fn capacity(&self) -> usize
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);
pub fn as_slice(&self) -> &[T]
1.7.0[src]
pub fn as_slice(&self) -> &[T]
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();
pub fn len(&self) -> usize
1.0.0[src]
pub fn len(&self) -> usize
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);
pub fn is_empty(&self) -> bool
1.0.0[src]
pub fn is_empty(&self) -> bool
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]
impl Clone for ContentEncoding
fn clone(&self) -> ContentEncoding
[src]
fn clone(&self) -> ContentEncoding
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for ContentEncoding
[src]
impl Debug for ContentEncoding
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for ContentEncoding
[src]
impl PartialEq for ContentEncoding
fn eq(&self, other: &ContentEncoding) -> bool
[src]
fn eq(&self, other: &ContentEncoding) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &ContentEncoding) -> bool
[src]
fn ne(&self, other: &ContentEncoding) -> bool
This method tests for !=
.
impl Deref for ContentEncoding
[src]
impl Deref for ContentEncoding
type Target = Vec<ContentCoding>
The resulting type after dereferencing.
fn deref(&self) -> &Vec<ContentCoding>
[src]
fn deref(&self) -> &Vec<ContentCoding>
Dereferences the value.
impl Header for ContentEncoding
[src]
impl Header for ContentEncoding
fn name() -> &'static HeaderName
[src]
fn name() -> &'static HeaderName
Returns the name of this header. Read more
fn from_values(
values: &mut ValueIter<HeaderValue>
) -> Result<Option<ContentEncoding>, Error>
[src]
fn from_values(
values: &mut ValueIter<HeaderValue>
) -> Result<Option<ContentEncoding>, Error>
Parses the header from the raw value bytes. Read more
fn to_values(&self, values: &mut ToValues)
[src]
fn to_values(&self, values: &mut ToValues)
Serializes the header to raw values. Read more
impl From<ContentCoding> for ContentEncoding
[src]
impl From<ContentCoding> for ContentEncoding
fn from(value: ContentCoding) -> ContentEncoding
[src]
fn from(value: ContentCoding) -> ContentEncoding
Performs the conversion.
Auto Trait Implementations
impl Send for ContentEncoding
impl Send for ContentEncoding
impl Sync for ContentEncoding
impl Sync for ContentEncoding