#[non_exhaustive]pub enum NeoTimeComponents {
Show 13 variants
Hour,
HourMinute,
HourMinuteSecond,
DayPeriodHour12,
Hour12,
DayPeriodHour12Minute,
Hour12Minute,
DayPeriodHour12MinuteSecond,
Hour12MinuteSecond,
Hour24,
Hour24Minute,
Hour24MinuteSecond,
Auto,
}
Expand description
A specification for a set of parts of a time. Only sets that yield “sensible” time are allowed: this type cannot describe a time such as “am, 5 minutes, 25 milliseconds”.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Hour
An hour (12-hour or 24-hour chosen by locale), as in “4 pm” or “16h”
HourMinute
An hour and minute (12-hour or 24-hour chosen by locale), as in “4:03 pm” or “16:03”
HourMinuteSecond
An hour, minute, and second (12-hour or 24-hour chosen by locale), as in “4:03:51 pm” or “16:03:51”
DayPeriodHour12
An hour with a 12-hour clock and day period, as in “4 in the afternoon”
Hour12
An hour with a 12-hour clock, as in “4 pm”
DayPeriodHour12Minute
An hour and minute with a 12-hour clock and a day period, as in “4:03 in the afternoon”
Hour12Minute
An hour and minute with a 12-hour clock, as in “4:03 pm”
DayPeriodHour12MinuteSecond
An hour, minute, and second with a 12-hour clock and day period, as in “4:03:51 in the afternoon”
Hour12MinuteSecond
An hour, minute, and second with a 12-hour clock, as in “4:03:51 pm”
Hour24
An hour with a 24-hour clock, as in “16h”
Hour24Minute
An hour and minute with a 24-hour clock, as in “16:03”
Hour24MinuteSecond
An hour, minute, and second with a 24-hour clock, as in “16:03:51”
Auto
Fields to represent the time chosen by the locale.
These are the standard time patterns for types “medium” and “short” as defined in UTS 35. For “full” and “long”, use a formatter that includes a time zone.
Implementations§
source§impl NeoTimeComponents
impl NeoTimeComponents
sourcepub const fn id_str(self) -> &'static DataMarkerAttributes
pub const fn id_str(self) -> &'static DataMarkerAttributes
Returns a stable string identifying this set of components.
For details, see NeoDayComponents::id_str()
.
sourcepub fn from_id_str(id_str: &DataMarkerAttributes) -> Option<Self>
pub fn from_id_str(id_str: &DataMarkerAttributes) -> Option<Self>
Returns the set of components for the given stable string.
For details, see NeoDayComponents::from_id_str()
.
sourcepub fn has_minute(self) -> bool
pub fn has_minute(self) -> bool
Whether this field set contains the minute.
sourcepub fn has_second(self) -> bool
pub fn has_second(self) -> bool
Whether this field set contains the second.
Trait Implementations§
source§impl Clone for NeoTimeComponents
impl Clone for NeoTimeComponents
source§fn clone(&self) -> NeoTimeComponents
fn clone(&self) -> NeoTimeComponents
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl DateTimeMarkers for NeoTimeComponents
impl DateTimeMarkers for NeoTimeComponents
§type D = NeoNeverMarker
type D = NeoNeverMarker
§type T = NeoTimeComponents
type T = NeoTimeComponents
§type Z = NeoNeverMarker
type Z = NeoNeverMarker
§type LengthOption = NeoSkeletonLength
type LengthOption = NeoSkeletonLength
§type AlignmentOption = Option<Alignment>
type AlignmentOption = Option<Alignment>
§type EraDisplayOption = NeverField
type EraDisplayOption = NeverField
§type FractionalSecondDigitsOption = Option<FractionalSecondDigits>
type FractionalSecondDigitsOption = Option<FractionalSecondDigits>
§type GluePatternV1Marker = NeverMarker<GluePatternV1<'static>>
type GluePatternV1Marker = NeverMarker<GluePatternV1<'static>>
source§impl Debug for NeoTimeComponents
impl Debug for NeoTimeComponents
source§impl From<NeoTimeComponents> for NeoComponents
impl From<NeoTimeComponents> for NeoComponents
source§fn from(value: NeoTimeComponents) -> Self
fn from(value: NeoTimeComponents) -> Self
source§impl From<NeoTimeComponents> for NeoDateTimeComponents
impl From<NeoTimeComponents> for NeoDateTimeComponents
source§fn from(value: NeoTimeComponents) -> Self
fn from(value: NeoTimeComponents) -> Self
source§impl Hash for NeoTimeComponents
impl Hash for NeoTimeComponents
source§impl PartialEq for NeoTimeComponents
impl PartialEq for NeoTimeComponents
source§fn eq(&self, other: &NeoTimeComponents) -> bool
fn eq(&self, other: &NeoTimeComponents) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl TimeMarkers for NeoTimeComponents
impl TimeMarkers for NeoTimeComponents
§type DayPeriodNamesV1Marker = DayPeriodNamesV1Marker
type DayPeriodNamesV1Marker = DayPeriodNamesV1Marker
§type TimeSkeletonPatternsV1Marker = TimeNeoSkeletonPatternsV1Marker
type TimeSkeletonPatternsV1Marker = TimeNeoSkeletonPatternsV1Marker
§type MinuteInput = IsoMinute
type MinuteInput = IsoMinute
§type SecondInput = IsoSecond
type SecondInput = IsoSecond
§type NanoSecondInput = NanoSecond
type NanoSecondInput = NanoSecond
impl Copy for NeoTimeComponents
impl Eq for NeoTimeComponents
impl IsRuntimeComponents for NeoTimeComponents
impl StructuralPartialEq for NeoTimeComponents
Auto Trait Implementations§
impl Freeze for NeoTimeComponents
impl RefUnwindSafe for NeoTimeComponents
impl Send for NeoTimeComponents
impl Sync for NeoTimeComponents
impl Unpin for NeoTimeComponents
impl UnwindSafe for NeoTimeComponents
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> 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