Struct hyper::header::AcceptCharset [] [src]

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

Examples

use hyper::header::{Headers, AcceptCharset, Charset, qitem};

let mut headers = Headers::new();
headers.set(
    AcceptCharset(vec![qitem(Charset::Us_Ascii)])
);
use hyper::header::{Headers, AcceptCharset, Charset, Quality, QualityItem};

let mut headers = Headers::new();
headers.set(
    AcceptCharset(vec![
        QualityItem::new(Charset::Us_Ascii, Quality(900)),
        QualityItem::new(Charset::Iso_8859_10, Quality(200)),
    ])
);
use hyper::header::{Headers, AcceptCharset, Charset, qitem};

let mut headers = Headers::new();
headers.set(
    AcceptCharset(vec![qitem(Charset::Ext("utf-8".to_owned()))])
);