Struct actix_web::http::header::AcceptCharset [−][src]
pub struct AcceptCharset(pub Vec<QualityItem<Charset>>);
Expand description
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 actix_web::HttpResponse;
use actix_web::http::header::{AcceptCharset, Charset, qitem};
let mut builder = HttpResponse::Ok();
builder.insert_header(
AcceptCharset(vec![qitem(Charset::Us_Ascii)])
);
use actix_web::HttpResponse;
use actix_web::http::header::{AcceptCharset, Charset, q, QualityItem};
let mut builder = HttpResponse::Ok();
builder.insert_header(
AcceptCharset(vec![
QualityItem::new(Charset::Us_Ascii, q(900)),
QualityItem::new(Charset::Iso_8859_10, q(200)),
])
);
use actix_web::HttpResponse;
use actix_web::http::header::{AcceptCharset, Charset, qitem};
let mut builder = HttpResponse::Ok();
builder.insert_header(
AcceptCharset(vec![qitem(Charset::Ext("utf-8".to_owned()))])
);
Tuple Fields
0: Vec<QualityItem<Charset>>
Trait Implementations
type Target = Vec<QualityItem<Charset>>
type Target = Vec<QualityItem<Charset>>
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Returns the name of the header field
Parse a header
type Error = InvalidHeaderValue
type Error = InvalidHeaderValue
The type returned in the event of a conversion error.
Try to convert value to a HeaderValue.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for AcceptCharset
impl Send for AcceptCharset
impl Sync for AcceptCharset
impl Unpin for AcceptCharset
impl UnwindSafe for AcceptCharset
Blanket Implementations
Mutably borrows from an owned value. Read more
type Error = <T as IntoHeaderValue>::Error
pub fn try_into_header_pair(
self
) -> Result<(HeaderName, HeaderValue), <T as IntoHeaderPair>::Error>
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more