#[non_exhaustive]pub enum HourCycle {
H12,
H23,
H11,
H24,
}
Expand description
A Unicode Hour Cycle Identifier defines the preferred time cycle. Specifying “hc” in a locale identifier overrides the default value specified by supplemental time data for the region.
The valid values are listed in LDML.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
H12
The typical 12-hour clock. Hours are numbered 1–12. Corresponds to ‘h’ in patterns.
H23
The 24-hour clock. Hour are numbered 0–23. Corresponds to ‘H’ in patterns.
H11
Variant of the 12-hour clock, sometimes used in Japan. Hours are numbered 0–11. Corresponds to ‘K’ in patterns.
H24
Variant of the 24-hour clock, not in common use. Hours are numbered 1–24. Corresponds to ‘k’ in patterns.
❗ This is not the typical 24-hour clock! See H23
above for the 24-hour clock used throughout most of the world.
Implementations§
Trait Implementations§
Source§impl PreferenceKey for HourCycle
impl PreferenceKey for HourCycle
Source§fn unicode_extension_key() -> Option<Key>
fn unicode_extension_key() -> Option<Key>
Retrieve unicode extension key corresponding to a given preference.
Source§fn try_from_key_value(
key: &Key,
value: &Value,
) -> Result<Option<HourCycle>, PreferencesParseError>
fn try_from_key_value( key: &Key, value: &Value, ) -> Result<Option<HourCycle>, PreferencesParseError>
Optional constructor of the given preference. It takes the
unicode extension key and if the key matches it attemptes to construct
the preference based on the given value.
If the value is not a valid value for the given key, the constructor throws.
Source§fn unicode_extension_value(&self) -> Option<Value>
fn unicode_extension_value(&self) -> Option<Value>
Retrieve unicode extension value corresponding to the given instance of the preference.
impl Copy for HourCycle
impl Eq for HourCycle
impl StructuralPartialEq for HourCycle
Auto Trait Implementations§
impl Freeze for HourCycle
impl RefUnwindSafe for HourCycle
impl Send for HourCycle
impl Sync for HourCycle
impl Unpin for HourCycle
impl UnwindSafe for HourCycle
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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