pub struct AcceptLanguage {
    pub accept_language: Vec<Locale>,
}
Expand description

The request guard used for getting accept-language header.

Fields§

§accept_language: Vec<Locale>

Implementations§

Get the first region. For example, a region can be "US", "TW" or "GB".

Get the first language. For example, a language can be "en", "zh" or "jp".

Get the first language-region pair. The region might not exist. For example, a language-region pair can be ("en", Some("US")), ("en", Some("GB")), ("zh", Some("TW")) or ("zh", None).

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
The associated error to be returned if derivation fails.
Derives an instance of Self from the incoming request metadata. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts self into a collection.
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Get the TypeId of this object.