#[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.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Year
impl<'de> Deserialize<'de> for Year
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Year, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Year, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§impl From<Year> for FieldSymbol
impl From<Year> for FieldSymbol
source§fn from(input: Year) -> FieldSymbol
fn from(input: Year) -> FieldSymbol
source§impl Ord for Year
impl Ord for Year
source§impl PartialEq for Year
impl PartialEq for Year
source§impl PartialOrd for Year
impl PartialOrd for Year
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more