Struct icu::calendar::types::FormattableYear
source · #[non_exhaustive]pub struct FormattableYear {
pub era: Era,
pub number: i32,
pub related_iso: Option<i32>,
}
Expand description
Representation of a formattable year.
More fields may be added in the future, for things like the cyclic or extended year
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.era: Era
The era containing the year.
number: i32
The year number in the current era (usually 1-based).
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§
source§impl FormattableYear
impl FormattableYear
sourcepub fn new(era: Era, number: i32) -> FormattableYear
pub fn new(era: Era, number: i32) -> FormattableYear
Construct a new Year given an era and number
Other fields can be set mutably after construction as needed
Trait Implementations§
source§impl Clone for FormattableYear
impl Clone for FormattableYear
source§fn clone(&self) -> FormattableYear
fn clone(&self) -> FormattableYear
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FormattableYear
impl Debug for FormattableYear
source§impl PartialEq<FormattableYear> for FormattableYear
impl PartialEq<FormattableYear> for FormattableYear
source§fn eq(&self, other: &FormattableYear) -> bool
fn eq(&self, other: &FormattableYear) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.