#[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
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
sourceimpl 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
sourceimpl Clone for FormattableYear
impl Clone for FormattableYear
sourcefn clone(&self) -> FormattableYear
fn clone(&self) -> FormattableYear
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for FormattableYear
impl Debug for FormattableYear
sourceimpl PartialEq<FormattableYear> for FormattableYear
impl PartialEq<FormattableYear> for FormattableYear
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &FormattableYear) -> bool
fn ne(&self, other: &FormattableYear) -> bool
This method tests for !=
.
impl Copy for FormattableYear
impl StructuralPartialEq for FormattableYear
Auto Trait Implementations
impl RefUnwindSafe for FormattableYear
impl Send for FormattableYear
impl Sync for FormattableYear
impl Unpin for FormattableYear
impl UnwindSafe for FormattableYear
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more