Skip to main content

LocaleOptions

Struct LocaleOptions 

Source
pub struct LocaleOptions<'a> {
    pub locale: &'a Locale,
    pub country: bool,
    pub encoding: bool,
    pub modifier: bool,
}
Expand description

Defines what options of a Locale are significant when searching for an entry.

Fields§

§locale: &'a Locale

A reference to the locale to be found.

§country: bool

Whether the country is significant.

§encoding: bool

Whether the country is significant.

§modifier: bool

Whether the country is significant.

Implementations§

Source§

impl<'a> LocaleOptions<'a>

Source

pub fn new(locale: &'a Locale) -> Self

Creates a new instance in which all options are insignificant (besides language).

Source

pub fn all(locale: &'a Locale) -> Self

Creates a new instance in which all options are significant.

Source

pub fn language_only(self) -> Self

Makes all options insignificant but the language.

Source

pub fn all_significant(self) -> Self

Makes all options significant.

Source

pub fn significant_encoding(self) -> Self

Makes the encoding significant.

Source

pub fn significant_country(self) -> Self

Makes the country significant.

Source

pub fn significant_modifiers(self) -> Self

Makes the modifiers significant.

Source

pub fn with_locale(self, locale: &'a Locale) -> Self

Changes the locale.

Auto Trait Implementations§

§

impl<'a> Freeze for LocaleOptions<'a>

§

impl<'a> RefUnwindSafe for LocaleOptions<'a>

§

impl<'a> Send for LocaleOptions<'a>

§

impl<'a> Sync for LocaleOptions<'a>

§

impl<'a> Unpin for LocaleOptions<'a>

§

impl<'a> UnsafeUnpin for LocaleOptions<'a>

§

impl<'a> UnwindSafe for LocaleOptions<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.