Enum icu_datetime::fieldset::dynamic::DateAndTimeFieldSet
source · #[non_exhaustive]pub enum DateAndTimeFieldSet {
DT(DT),
MDT(MDT),
YMDT(YMDT),
DET(DET),
MDET(MDET),
YMDET(YMDET),
ET(ET),
}
Expand description
An enumeration over all possible date+time composite field sets.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DT(DT)
The day of the month with time of day, as in “on the 1st at 10:31 AM”.
MDT(MDT)
The month and day of the month with time of day, as in “January 1st at 10:31 AM”.
YMDT(YMDT)
The year, month, and day of the month with time of day, as in “January 1st, 2000 at 10:31 AM”.
DET(DET)
The day of the month and day of the week with time of day, as in “Saturday 1st at 10:31 AM”.
MDET(MDET)
The month, day of the month, and day of the week with time of day, as in “Saturday, January 1st at 10:31 AM”.
YMDET(YMDET)
The year, month, day of the month, and day of the week with time of day, as in “Saturday, January 1st, 2000 at 10:31 AM”.
ET(ET)
The day of the week alone with time of day, as in “Saturday at 10:31 AM”.
Implementations§
source§impl DateAndTimeFieldSet
impl DateAndTimeFieldSet
sourcepub const ALL_DATA_MARKER_ATTRIBUTES: &'static [&'static DataMarkerAttributes] = _
pub const ALL_DATA_MARKER_ATTRIBUTES: &'static [&'static DataMarkerAttributes] = _
All attributes associated with this enum.
§Encoding Details
The string is based roughly on the UTS 35 symbol table with the following exceptions:
- Lowercase letters are chosen where there is no ambiguity:
E
becomese
- Capitals are replaced with their lowercase and a number 0:
M
becomesm0
- A single symbol is included for each component: length doesn’t matter
- Time fields are encoded with their hour field only:
j
,h
, orh0
§Examples
use icu::datetime::fieldset::dynamic::DateAndTimeFieldSet as FS;
use icu_provider::DataMarkerAttributes;
assert!(FS::ALL_DATA_MARKER_ATTRIBUTES.contains(
&DataMarkerAttributes::from_str_or_panic("ej")
));
source§impl DateAndTimeFieldSet
impl DateAndTimeFieldSet
sourcepub fn zone_z(self) -> Combo<Self, Zs>
pub fn zone_z(self) -> Combo<Self, Zs>
Associates this field set with a specific non-location format time zone, as in “Pacific Daylight Time”.
sourcepub fn zone_o(self) -> Combo<Self, O>
pub fn zone_o(self) -> Combo<Self, O>
Associates this field set with an offset format time zone, as in “GMT−8”.
Trait Implementations§
source§impl Clone for DateAndTimeFieldSet
impl Clone for DateAndTimeFieldSet
source§fn clone(&self) -> DateAndTimeFieldSet
fn clone(&self) -> DateAndTimeFieldSet
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DateAndTimeFieldSet
impl Debug for DateAndTimeFieldSet
source§impl GetField<CompositeFieldSet> for DateAndTimeFieldSet
impl GetField<CompositeFieldSet> for DateAndTimeFieldSet
source§fn get_field(&self) -> CompositeFieldSet
fn get_field(&self) -> CompositeFieldSet
T
.source§impl PartialEq for DateAndTimeFieldSet
impl PartialEq for DateAndTimeFieldSet
impl Copy for DateAndTimeFieldSet
impl Eq for DateAndTimeFieldSet
impl StructuralPartialEq for DateAndTimeFieldSet
Auto Trait Implementations§
impl Freeze for DateAndTimeFieldSet
impl RefUnwindSafe for DateAndTimeFieldSet
impl Send for DateAndTimeFieldSet
impl Sync for DateAndTimeFieldSet
impl Unpin for DateAndTimeFieldSet
impl UnwindSafe for DateAndTimeFieldSet
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