Struct icu_provider_export::DataLocaleFamily
source · 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")
.
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 · 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
impl Display for DataLocaleFamily
This trait is implemented for compatibility with fmt!
.
To create a string, [Writeable::write_to_string
] is usually more efficient.
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
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
§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.§fn write_to_string(&self) -> Cow<'_, str>
fn write_to_string(&self) -> Cow<'_, str>
String
with the data from this Writeable
. Like ToString
,
but smaller and faster. Read moreimpl Eq for DataLocaleFamily
impl StructuralPartialEq for DataLocaleFamily
Auto Trait Implementations§
impl Freeze for DataLocaleFamily
impl RefUnwindSafe for DataLocaleFamily
impl Send for DataLocaleFamily
impl Sync for DataLocaleFamily
impl Unpin 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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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