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()))]) );
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 = InvalidHeaderValueThe 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 AcceptCharsetimpl Send for AcceptCharsetimpl Sync for AcceptCharsetimpl Unpin for AcceptCharsetimpl UnwindSafe for AcceptCharsetBlanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Error = <T as IntoHeaderValue>::Errorpub fn try_into_header_pair(
self
) -> Result<(HeaderName, HeaderValue), <T as IntoHeaderPair>::Error>type Output = T
type Output = TShould always be Self
pub fn vzip(self) -> V