Struct icu_datetime::input::FormattableYear
source · #[non_exhaustive]pub(crate) struct FormattableYear {
pub era: Era,
pub number: i32,
pub cyclic: Option<NonZero<u8>>,
pub related_iso: Option<i32>,
}
Expand description
Representation of a formattable year.
More fields may be added in the future for things like extended year
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.era: Era
The era containing the year.
This may not always be the canonical era for the calendar and could be an alias,
for example all islamic
calendars return islamic
as the formattable era code
which allows them to share data.
number: i32
The year number in the current era (usually 1-based).
cyclic: Option<NonZero<u8>>
The year in the current cycle for cyclic calendars (1-indexed)
can be set to None
for non-cyclic calendars
For chinese and dangi it will be a number between 1 and 60, for hypothetical other calendars it may be something else.
The related ISO year. This is normally the ISO (proleptic Gregorian) year having the greatest overlap with the calendar year. It is used in certain date formatting patterns.
Can be None
if the calendar does not typically use related_iso
(and CLDR does not contain patterns
using it)
Implementations§
Trait Implementations§
source§impl Clone for FormattableYear
impl Clone for FormattableYear
source§fn clone(&self) -> FormattableYear
fn clone(&self) -> FormattableYear
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FormattableYear
impl Debug for FormattableYear
source§impl PartialEq for FormattableYear
impl PartialEq for FormattableYear
source§fn eq(&self, other: &FormattableYear) -> bool
fn eq(&self, other: &FormattableYear) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for FormattableYear
impl StructuralPartialEq for FormattableYear
Auto Trait Implementations§
impl Freeze for FormattableYear
impl RefUnwindSafe for FormattableYear
impl Send for FormattableYear
impl Sync for FormattableYear
impl Unpin for FormattableYear
impl UnwindSafe for FormattableYear
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> 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