Struct icu_calendar::types::FormattableYear
source · #[non_exhaustive]pub struct FormattableYear {
pub era: Era,
pub number: i32,
pub cyclic: Option<NonZeroU8>,
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<NonZeroU8>
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
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> 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
)