[][src]Struct requiem_http::http::header::AcceptCharset

pub struct AcceptCharset(pub Vec<QualityItem<Charset>>);

Accept-Charset header, defined in RFC7231

The Accept-Charset header field can be sent by a user agent to indicate what charsets are acceptable in textual response content. This field allows user agents capable of understanding more comprehensive or special-purpose charsets to signal that capability to an origin server that is capable of representing information in those charsets.

ABNF

Accept-Charset = 1#( ( charset / "*" ) [ weight ] )

Example values

  • iso-8859-5, unicode-1-1;q=0.8

Examples

use requiem_http::Response;
use requiem_http::http::header::{AcceptCharset, Charset, qitem};

let mut builder = Response::Ok();
builder.set(
    AcceptCharset(vec![qitem(Charset::Us_Ascii)])
);
use requiem_http::Response;
use requiem_http::http::header::{AcceptCharset, Charset, q, QualityItem};

let mut builder = Response::Ok();
builder.set(
    AcceptCharset(vec![
        QualityItem::new(Charset::Us_Ascii, q(900)),
        QualityItem::new(Charset::Iso_8859_10, q(200)),
    ])
);
use requiem_http::Response;
use requiem_http::http::header::{AcceptCharset, Charset, qitem};

let mut builder = Response::Ok();
builder.set(
    AcceptCharset(vec![qitem(Charset::Ext("utf-8".to_owned()))])
);

Trait Implementations

impl Clone for AcceptCharset[src]

impl Debug for AcceptCharset[src]

impl Deref for AcceptCharset[src]

type Target = Vec<QualityItem<Charset>>

The resulting type after dereferencing.

impl DerefMut for AcceptCharset[src]

impl Display for AcceptCharset[src]

impl Header for AcceptCharset[src]

impl IntoHeaderValue for AcceptCharset[src]

type Error = InvalidHeaderValue

The type returned in the event of a conversion error.

impl PartialEq<AcceptCharset> for AcceptCharset[src]

impl StructuralPartialEq for AcceptCharset[src]

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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>,