Enum icu_datetime::options::preferences::HourCycle

source ยท
pub enum HourCycle {
    H24,
    H23,
    H12,
    H11,
}
Expand description

A user preference for adjusting how the hour component is displayed.

๐Ÿšง This code is experimental; it may change at any time, in breaking or non-breaking ways, including in SemVer minor releases. It can be enabled with the "experimental" Cargo feature of the icu meta-crate. Use with caution. #1317

Variantsยง

ยง

H24

Hour is formatted to be in range 1-24 where midnight is 24:00.

ยงExamples

"24:12";
"8:23";
"19:00";
"23:21";
ยง

H23

Hour is formatted to be in range 0-23 where midnight is 00:00.

ยงExamples

"0:12";
"8:23";
"19:00";
"23:21";
ยง

H12

Hour is formatted to be in range 1-12 where midnight is 12:00.

ยงExamples

"1:12";
"8:23";
"7:00";
"11:21";
ยง

H11

Hour is formatted to be in range 0-11 where midnight is 00:00.

ยงExamples

"0:12";
"8:23";
"7:00";
"11:21";

Implementationsยง

sourceยง

impl HourCycle

source

pub fn field(self) -> Hour

Convert the HourCycle preference to a field.

Trait Implementationsยง

sourceยง

impl Clone for HourCycle

sourceยง

fn clone(&self) -> HourCycle

Returns a copy of the value. Read more
1.0.0 ยท sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
sourceยง

impl Debug for HourCycle

sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
sourceยง

impl Hash for HourCycle

sourceยง

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 ยท sourceยง

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
sourceยง

impl PartialEq for HourCycle

sourceยง

fn eq(&self, other: &HourCycle) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 ยท sourceยง

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
sourceยง

impl Copy for HourCycle

sourceยง

impl Eq for HourCycle

sourceยง

impl StructuralPartialEq for HourCycle

Auto Trait Implementationsยง

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> IntoEither for T

sourceยง

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 more
sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
sourceยง

impl<T> ToOwned for T
where T: Clone,

ยง

type Owned = T

The resulting type after obtaining ownership.
sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
sourceยง

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

ยง

type Error = Infallible

The type returned in the event of a conversion error.
sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
sourceยง

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

ยง

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.
sourceยง

impl<T> ErasedDestructor for T
where T: 'static,

sourceยง

impl<T> MaybeSendSync for T