pub enum Era {
BCE,
CE,
}
Expand description
The era corresponding to a particular year.
The BCE era corresponds to years less than or equal to 0
, while the CE
era corresponds to years greater than 0
.
In particular, this crate allows years to be negative and also to be 0
,
which is contrary to the common practice of excluding the year 0
when
writing dates for the Gregorian calendar. Moreover, common practice eschews
negative years in favor of labeling a year with an era notation. That is,
the year 1 BCE
is year 0
in this crate. The year 2 BCE
is the year
-1
in this crate.
To get the year in its era format, use Date::era_year
.
Variants§
BCE
The “before common era” era.
This corresponds to all years less than or equal to 0
.
This is precisely equivalent to the “BC” or “before Christ” era.
CE
The “common era” era.
This corresponds to all years greater than 0
.
This is precisely equivalent to the “AD” or “anno Domini” or “in the year of the Lord” era.
Trait Implementations§
impl Copy for Era
impl Eq for Era
impl StructuralPartialEq for Era
Auto Trait Implementations§
impl Freeze for Era
impl RefUnwindSafe for Era
impl Send for Era
impl Sync for Era
impl Unpin for Era
impl UnwindSafe for Era
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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