Enum icu_datetime::fieldsets::enums::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.
This is a dynamic field set. For more information, see enums
.
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::fieldsets::enums::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 with_zone_specific_long(self) -> Combo<Self, Z>
pub fn with_zone_specific_long(self) -> Combo<Self, Z>
Associates this field set with a long specific non-location format time zone, as in “Pacific Daylight Time”.
sourcepub fn with_zone_specific(self) -> Combo<Self, Zs>
pub fn with_zone_specific(self) -> Combo<Self, Zs>
Associates this field set with a short specific non-location format time zone, as in “PDT”.
sourcepub fn with_zone_offset_long(self) -> Combo<Self, O>
pub fn with_zone_offset_long(self) -> Combo<Self, O>
Associates this field set with a long offset format time zone, as in “GMT−08:00”.
sourcepub fn with_zone_offset(self) -> Combo<Self, Os>
pub fn with_zone_offset(self) -> Combo<Self, Os>
Associates this field set with a short offset format time zone, as in “GMT−8”.
sourcepub fn with_zone_generic_long(self) -> Combo<Self, V>
pub fn with_zone_generic_long(self) -> Combo<Self, V>
Associates this field set with a long generic non-location format time zone, as in “Pacific Time”.
sourcepub fn with_zone_generic(self) -> Combo<Self, Vs>
pub fn with_zone_generic(self) -> Combo<Self, Vs>
Associates this field set with a short generic non-location format time zone, as in “PT”.
sourcepub fn with_zone_location(self) -> Combo<Self, L>
pub fn with_zone_location(self) -> Combo<Self, L>
Associates this field set with a location format time zone, as in “Los Angeles time”.
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
impl UnstableSealed 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> GetField<T> for Twhere
T: Copy + UnstableSealed,
impl<T> GetField<T> for Twhere
T: Copy + UnstableSealed,
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