Struct actix_web::http::header::ContentLanguage [−][src]
pub struct ContentLanguage(pub Vec<QualityItem<LanguageTag>>);
Expand description
Content-Language
header, defined in
RFC7231
The Content-Language
header field describes the natural language(s)
of the intended audience for the representation. Note that this
might not be equivalent to all the languages used within the
representation.
ABNF
Content-Language = 1#language-tag
Example values
da
mi, en
Examples
use actix_web::HttpResponse;
use actix_web::http::header::{ContentLanguage, LanguageTag, qitem};
let mut builder = HttpResponse::Ok();
builder.insert_header(
ContentLanguage(vec![
qitem(LanguageTag::parse("en").unwrap()),
])
);
use actix_web::HttpResponse;
use actix_web::http::header::{ContentLanguage, LanguageTag, qitem};
let mut builder = HttpResponse::Ok();
builder.insert_header(
ContentLanguage(vec![
qitem(LanguageTag::parse("da").unwrap()),
qitem(LanguageTag::parse("en-GB").unwrap()),
])
);
Tuple Fields
0: Vec<QualityItem<LanguageTag>>
Trait Implementations
type Target = Vec<QualityItem<LanguageTag>>
type Target = Vec<QualityItem<LanguageTag>>
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 ContentLanguage
impl Send for ContentLanguage
impl Sync for ContentLanguage
impl Unpin for ContentLanguage
impl UnwindSafe for ContentLanguage
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