#[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: EraThe 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: i32The 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,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes