Enum icu::datetime::neo_skeleton::TimePrecision
source · #[non_exhaustive]pub enum TimePrecision {
HourPlus,
HourExact,
MinutePlus,
MinuteExact,
SecondPlus,
SecondExact(FractionalSecondDigits),
}
Expand description
A specification for how precisely to display the time of day.
The examples below are based on the following inputs and hour cycles:
- 11 o’clock with 12-hour time
- 16:20 (4:20 pm) with 24-hour time
- 7:15:01.85 with 24-hour time
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.
HourPlus
Always display the hour. Display smaller fields if they are nonzero.
Examples:
11 am
16:20
07:15:01.85
HourExact
Always display the hour. Hide all other time fields.
Examples:
11 am
16h
07h
MinutePlus
Always display the hour and minute. Display the second if nonzero.
Examples:
11:00 am
16:20
07:15:01.85
MinuteExact
Always display the hour and minute. Hide the second.
Examples:
11:00 am
16:20
07:15
SecondPlus
Display the hour, minute, and second. Display fractional seconds if nonzero.
This is the default.
Examples:
11:00:00 am
16:20:00
07:15:01.85
SecondExact(FractionalSecondDigits)
Display the hour, minute, and second with the given number of fractional second digits.
Examples with FractionalSecondDigits::F1
:
11:00:00.0 am
16:20:00.0
07:15:01.8
Trait Implementations§
source§impl Clone for TimePrecision
impl Clone for TimePrecision
source§fn clone(&self) -> TimePrecision
fn clone(&self) -> TimePrecision
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TimePrecision
impl Debug for TimePrecision
source§impl<'de> Deserialize<'de> for TimePrecision
impl<'de> Deserialize<'de> for TimePrecision
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TimePrecision, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TimePrecision, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<TimePrecisionSerde> for TimePrecision
impl From<TimePrecisionSerde> for TimePrecision
source§fn from(value: TimePrecisionSerde) -> TimePrecision
fn from(value: TimePrecisionSerde) -> TimePrecision
Converts to this type from the input type.
source§impl Hash for TimePrecision
impl Hash for TimePrecision
source§impl IntoOption<TimePrecision> for TimePrecision
impl IntoOption<TimePrecision> for TimePrecision
source§fn into_option(self) -> Option<TimePrecision>
fn into_option(self) -> Option<TimePrecision>
Return
self
as an Option<T>
source§impl PartialEq for TimePrecision
impl PartialEq for TimePrecision
source§impl Serialize for TimePrecision
impl Serialize for TimePrecision
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for TimePrecision
impl Eq for TimePrecision
impl StructuralPartialEq for TimePrecision
Auto Trait Implementations§
impl Freeze for TimePrecision
impl RefUnwindSafe for TimePrecision
impl Send for TimePrecision
impl Sync for TimePrecision
impl Unpin for TimePrecision
impl UnwindSafe for TimePrecision
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
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>
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