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
dami, 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()), ]) );
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 = 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 ContentLanguageimpl Send for ContentLanguageimpl Sync for ContentLanguageimpl Unpin for ContentLanguageimpl UnwindSafe for ContentLanguageBlanket 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