Struct actix_http::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_http::Response; use actix_http::http::header::{AcceptCharset, Charset, qitem}; let mut builder = Response::Ok(); builder.set( AcceptCharset(vec![qitem(Charset::Us_Ascii)]) );
use actix_http::Response; use actix_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 actix_http::Response; use actix_http::http::header::{AcceptCharset, Charset, qitem}; let mut builder = Response::Ok(); builder.set( AcceptCharset(vec![qitem(Charset::Ext("utf-8".to_owned()))]) );
Tuple Fields
0: Vec<QualityItem<Charset>>
Trait Implementations
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 Header value.
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
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self