pub struct DataLocaleFamily { /* private fields */ }Expand description
A family of locales to export.
Implementations§
Source§impl DataLocaleFamily
impl DataLocaleFamily
Sourcepub fn with_descendants(locale: DataLocale) -> Self
pub fn with_descendants(locale: DataLocale) -> 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”
The und locale is treated specially and behaves like ::single("und").
Sourcepub fn without_descendants(locale: DataLocale) -> Self
pub fn without_descendants(locale: DataLocale) -> 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”
The und locale is treated specially and behaves like ::single("und").
Sourcepub fn without_ancestors(locale: DataLocale) -> Self
pub fn without_ancestors(locale: DataLocale) -> 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”
The und locale is treated specially and behaves like ::single("und").
Sourcepub const fn single(locale: DataLocale) -> Self
pub const fn single(locale: DataLocale) -> 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”
Source§impl DataLocaleFamily
impl DataLocaleFamily
Sourcepub fn try_from_utf8(
code_units: &[u8],
) -> Result<Self, DataLocaleFamilyParseError>
pub fn try_from_utf8( code_units: &[u8], ) -> Result<Self, DataLocaleFamilyParseError>
Parses a DataLocaleFamily from a UTF-8 slice.
Sourcepub fn try_from_str(s: &str) -> Result<Self, DataLocaleFamilyParseError>
pub fn try_from_str(s: &str) -> Result<Self, DataLocaleFamilyParseError>
Parses a DataLocaleFamily.
Trait Implementations§
Source§impl Clone for DataLocaleFamily
impl Clone for DataLocaleFamily
Source§fn clone(&self) -> DataLocaleFamily
fn clone(&self) -> DataLocaleFamily
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DataLocaleFamily
impl Debug for DataLocaleFamily
Source§impl Display for DataLocaleFamily
This trait is implemented for compatibility with fmt!.
To create a string, Writeable::write_to_string is usually more efficient.
impl Display for DataLocaleFamily
This trait is implemented for compatibility with fmt!.
To create a string, Writeable::write_to_string is usually more efficient.
impl Eq for DataLocaleFamily
Source§impl FromStr for DataLocaleFamily
impl FromStr for DataLocaleFamily
Source§impl Hash for DataLocaleFamily
impl Hash for DataLocaleFamily
Source§impl PartialEq for DataLocaleFamily
impl PartialEq for DataLocaleFamily
impl StructuralPartialEq for DataLocaleFamily
Source§impl Writeable for DataLocaleFamily
impl Writeable for DataLocaleFamily
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.Source§fn writeable_borrow(&self) -> Option<&str>
fn writeable_borrow(&self) -> Option<&str>
Auto Trait Implementations§
impl Freeze for DataLocaleFamily
impl RefUnwindSafe for DataLocaleFamily
impl Send for DataLocaleFamily
impl Sync for DataLocaleFamily
impl Unpin for DataLocaleFamily
impl UnsafeUnpin for DataLocaleFamily
impl UnwindSafe for DataLocaleFamily
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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