#[non_exhaustive]pub struct YearInfo {
pub extended_year: i32,
pub kind: YearKind,
}
Expand description
General information about a 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.extended_year: i32
The “extended year”, typically anchored with year 1 as the year 1 of either the most modern or otherwise some “major” era for the calendar
kind: YearKind
The rest of the details about the year
Implementations§
source§impl YearInfo
impl YearInfo
sourcepub fn era_year(self) -> Option<i32>
pub fn era_year(self) -> Option<i32>
Get the year in the era if this is a non-cyclic calendar
Gets the eraYear for era dates, otherwise falls back to Extended Year
sourcepub fn year_ambiguity(self) -> YearAmbiguity
pub fn year_ambiguity(self) -> YearAmbiguity
Get the year ambiguity.
sourcepub fn era_year_or_extended(self) -> i32
pub fn era_year_or_extended(self) -> i32
Get some year number that can be displayed
Gets the eraYear for era dates, otherwise falls back to Extended Year
sourcepub fn formatting_era(self) -> Option<FormattingEra>
pub fn formatting_era(self) -> Option<FormattingEra>
Get the era, if available
sourcepub fn standard_era(self) -> Option<Era>
pub fn standard_era(self) -> Option<Era>
Get the era, if available
Return the Related ISO year, if any
Trait Implementations§
source§impl<C, A, Z> GetField<YearInfo> for CustomZonedDateTime<A, Z>where
C: Calendar,
A: AsCalendar<Calendar = C>,
impl<C, A, Z> GetField<YearInfo> for CustomZonedDateTime<A, Z>where
C: Calendar,
A: AsCalendar<Calendar = C>,
source§impl IntoOption<YearInfo> for YearInfo
impl IntoOption<YearInfo> for YearInfo
source§fn into_option(self) -> Option<YearInfo>
fn into_option(self) -> Option<YearInfo>
Return
self
as an Option<T>
impl Copy for YearInfo
impl StructuralPartialEq for YearInfo
Auto Trait Implementations§
impl Freeze for YearInfo
impl RefUnwindSafe for YearInfo
impl Send for YearInfo
impl Sync for YearInfo
impl Unpin for YearInfo
impl UnwindSafe for YearInfo
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
Converts
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>
Converts
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