Enum icu_datetime::fields::Year
source · [−]#[repr(u8)]
pub enum Year {
Calendar,
WeekOf,
}
Expand description
An enum for the possible symbols of a year field in a date pattern.
Variants
Calendar
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
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.
Trait Implementations
sourceimpl Bake for Year
impl Bake for Year
sourcefn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
Returns a TokenStream
that would evalutate to self
. Read more
sourceimpl<'de> Deserialize<'de> for Year
impl<'de> Deserialize<'de> for Year
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<Year> for FieldSymbol
impl From<Year> for FieldSymbol
sourceimpl Ord for Year
impl Ord for Year
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Year> for Year
impl PartialOrd<Year> for Year
sourcefn partial_cmp(&self, other: &Year) -> Option<Ordering>
fn partial_cmp(&self, other: &Year) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<'a> Yokeable<'a> for Year
impl<'a> Yokeable<'a> for Year
sourcefn transform(&self) -> &Self::Output
fn transform(&self) -> &Self::Output
This method must cast self
between &'a Self<'static>
and &'a Self<'a>
. Read more
sourcefn transform_owned(self) -> Self::Output
fn transform_owned(self) -> Self::Output
This method must cast self
between Self<'static>
and Self<'a>
. Read more
sourceunsafe fn make(this: Self::Output) -> Self
unsafe fn make(this: Self::Output) -> Self
This method can be used to cast away Self<'a>
’s lifetime. Read more
sourcefn transform_mut<F>(&'a mut self, f: F) where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
fn transform_mut<F>(&'a mut self, f: F) where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
This method must cast self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read more
sourceimpl<'a> ZeroMapKV<'a> for Year
impl<'a> ZeroMapKV<'a> for Year
impl Copy for Year
impl Eq for Year
impl<'a> IsCovariant<'a> for Year
impl StructuralEq for Year
impl StructuralPartialEq for Year
Auto Trait Implementations
impl RefUnwindSafe for Year
impl Send for Year
impl Sync for Year
impl Unpin for Year
impl UnwindSafe for Year
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more