Enum icu::calendar::types::FormattingEra
source · #[non_exhaustive]pub enum FormattingEra {
Index(u8, TinyAsciiStr<16>),
Code(Era),
}
Expand description
Information about the era as usable for formatting
This is optimized for storing datetime formatting data.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Index(u8, TinyAsciiStr<16>)
An Era Index, for calendars with a small, fixed set of eras. The eras are indexed chronologically.
In this context, chronological ordering of eras is obtained by ordering by their start date (or in the case of negative eras, their end date) first, and for eras sharing a date, put the negative one first. For example, bce < ce, and mundi < pre-incar < incar for Ethiopian.
The TInyStr16 is a fallback string for the era when a display name is not available. It need not be an era code, it should be something sensible (or empty).
Code(Era)
An era code, for calendars with a large set of era codes (Japanese)
This code may not be the canonical era code, but will typically be a valid era alias
Implementations§
source§impl FormattingEra
impl FormattingEra
sourcepub fn fallback_name(self) -> TinyAsciiStr<16>
pub fn fallback_name(self) -> TinyAsciiStr<16>
Get a fallback era name suitable for display to the user when the real era name is not availabe
Trait Implementations§
source§impl Clone for FormattingEra
impl Clone for FormattingEra
source§fn clone(&self) -> FormattingEra
fn clone(&self) -> FormattingEra
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FormattingEra
impl Debug for FormattingEra
source§impl PartialEq for FormattingEra
impl PartialEq for FormattingEra
impl Copy for FormattingEra
impl StructuralPartialEq for FormattingEra
Auto Trait Implementations§
impl Freeze for FormattingEra
impl RefUnwindSafe for FormattingEra
impl Send for FormattingEra
impl Sync for FormattingEra
impl Unpin for FormattingEra
impl UnwindSafe for FormattingEra
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
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>
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