Enum icu_datetime::fields::Year
source · #[repr(u8)]pub enum Year {
Calendar = 0,
WeekOf = 1,
Cyclic = 2,
RelatedIso = 3,
}
Expand description
An enum for the possible symbols of a year field in a date pattern.
Variants§
Calendar = 0
Field symbol for calendar year (numeric).
In most cases the length of this field specifies the minimum number of digits to display, zero-padded as necessary. For most use cases, Year::Calendar
or Year::WeekOf
should be adequate.
This field symbol is represented by the character y
in a date formatting pattern string.
For more details, see documentation on date field symbols.
WeekOf = 1
Field symbol for year in “week of year”.
This works for “week of year” based calendars in which the year transition occurs on a week boundary; may differ from calendar year Year::Calendar
near a year transition. This numeric year designation is used in conjunction with Week::WeekOfYear
, but can be used in non-Gregorian based calendar systems where week date processing is desired. The field length is interpreted in the same way as for Year::Calendar
.
This field symbol is represented by the character Y
in a date formatting pattern string.
For more details, see documentation on date field symbols.
Cyclic = 2
Field symbol for cyclic year; used in calendars where years are tracked in cycles, such as the Chinese or Dangi calendars.
This field symbol is represented by the character U
in a date formatting pattern string.
For more details, see documentation on date field symbols.
RelatedIso = 3
Field symbol for related ISO; some calendars which use different year numbering than ISO, or no year numbering, may express years in an ISO year corresponding to a calendar year.
This field symbol is represented by the character r
in a date formatting pattern string.
For more details, see documentation on date field symbols.
Implementations§
source§impl Year
impl Year
sourcepub(crate) fn new_from_u8(value: u8) -> Option<Self>
pub(crate) fn new_from_u8(value: u8) -> Option<Self>
Attempt to construct the value from its corresponding integer,
returning None
if not possible
Trait Implementations§
source§impl From<Year> for FieldSymbol
impl From<Year> for FieldSymbol
source§impl Ord for Year
impl Ord for Year
source§impl PartialOrd for Year
impl PartialOrd for Year
source§impl<'a> Yokeable<'a> for Yearwhere
Self: Sized,
impl<'a> Yokeable<'a> for Yearwhere
Self: Sized,
source§impl<'a> ZeroMapKV<'a> for Year
impl<'a> ZeroMapKV<'a> for Year
impl Copy for Year
impl Eq for Year
impl StructuralPartialEq for Year
Auto Trait Implementations§
impl Freeze for Year
impl RefUnwindSafe for Year
impl Send for Year
impl Sync for Year
impl Unpin for Year
impl UnwindSafe for Year
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