pub struct LocaleFamily { /* private fields */ }
Expand description
A family of locales to export.
Implementations§
Source§impl LocaleFamily
impl LocaleFamily
Sourcepub const fn with_descendants(langid: LanguageIdentifier) -> Self
pub const fn with_descendants(langid: LanguageIdentifier) -> Self
The family containing all ancestors and descendants of the selected locale.
This is the recommended family type since it reflects regional preferences.
For example, the family ::with_descendants("en-001")
contains:
- Self: “en-001”
- Ancestors: “und”, “en”
- Descendants: “en-GB”, “en-ZA”, …
Stylized on the CLI as: “en-US”
Sourcepub const fn without_descendants(langid: LanguageIdentifier) -> Self
pub const fn without_descendants(langid: LanguageIdentifier) -> Self
The family containing all ancestors of the selected locale.
This family type does not include regional variants unless the selected locale is itself a regional variant.
For example, the family ::without_descendants("en-001")
contains:
- Self: “en-001”
- Ancestors: “und”, “en”
Stylized on the CLI as: “^en-US”
Sourcepub const fn without_ancestors(langid: LanguageIdentifier) -> Self
pub const fn without_ancestors(langid: LanguageIdentifier) -> Self
The family containing all descendants of the selected locale.
This family may be useful if the root locale is not desired.
For example, the family ::without_ancestors("en-001")
contains:
- Self: “en-001”
- Descendants: “en-GB”, “en-ZA”, …
but it does not contain the ancestors “en” and “und”.
Stylized on the CLI as: “%en-US”
Sourcepub const fn single(langid: LanguageIdentifier) -> Self
pub const fn single(langid: LanguageIdentifier) -> Self
The family containing only the selected locale.
For example, the family ::single("en-001")
contains only “en-001”.
Stylized on the CLI as: “@en-US”
Trait Implementations§
Source§impl Clone for LocaleFamily
impl Clone for LocaleFamily
Source§fn clone(&self) -> LocaleFamily
fn clone(&self) -> LocaleFamily
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for LocaleFamily
impl Debug for LocaleFamily
Source§impl Display for LocaleFamily
This trait is implemented for compatibility with fmt!
.
To create a string, Writeable::write_to_string
is usually more efficient.
impl Display for LocaleFamily
This trait is implemented for compatibility with fmt!
.
To create a string, Writeable::write_to_string
is usually more efficient.
Source§impl FromStr for LocaleFamily
impl FromStr for LocaleFamily
Source§impl Hash for LocaleFamily
impl Hash for LocaleFamily
Source§impl PartialEq for LocaleFamily
impl PartialEq for LocaleFamily
Source§impl Writeable for LocaleFamily
impl Writeable for LocaleFamily
Source§fn write_to<W: Write + ?Sized>(&self, sink: &mut W) -> Result
fn write_to<W: Write + ?Sized>(&self, sink: &mut W) -> Result
write_to_parts
, and discards any
Part
annotations.Source§fn writeable_length_hint(&self) -> LengthHint
fn writeable_length_hint(&self) -> LengthHint
Source§fn write_to_parts<S>(&self, sink: &mut S) -> Result<(), Error>where
S: PartsWrite + ?Sized,
fn write_to_parts<S>(&self, sink: &mut S) -> Result<(), Error>where
S: PartsWrite + ?Sized,
Part
annotations to the given sink. Errors from the
sink are bubbled up. The default implementation delegates to write_to
,
and doesn’t produce any Part
annotations.impl Eq for LocaleFamily
impl StructuralPartialEq for LocaleFamily
Auto Trait Implementations§
impl Freeze for LocaleFamily
impl RefUnwindSafe for LocaleFamily
impl Send for LocaleFamily
impl Sync for LocaleFamily
impl Unpin for LocaleFamily
impl UnwindSafe for LocaleFamily
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more