Struct icu_datetime::provider::calendar::Eras
source · pub struct Eras<'data> {
pub names: ZeroMap<'data, PotentialUtf8, str>,
pub abbr: ZeroMap<'data, PotentialUtf8, str>,
pub narrow: ZeroMap<'data, PotentialUtf8, str>,
}
Expand description
String data for the name, abbreviation, and narrow form of a date’s era.
Keys of the map represent era codes, and the values are the display names.
Era codes are derived from CLDR data, and are calendar specific.
Some examples include: "be"
, "0"
/ "1"
, "bce"
/ "ce"
,
"heisei"
/ "meiji"
/ "reiwa"
/ … Not all era codes are inherited as-is,
such as for the extended Japanese calendar.
For more information on date time symbols, see FieldSymbol
.
🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways,
including in SemVer minor releases. While the serde representation of data structs is guaranteed
to be stable, their Rust representation might not be. Use with caution.
Fields§
§names: ZeroMap<'data, PotentialUtf8, str>
Symbol data for era names.
Keys are era codes, and values are display names. See Eras
.
abbr: ZeroMap<'data, PotentialUtf8, str>
Symbol data for era abbreviations.
Keys are era codes, and values are display names. See Eras
.
narrow: ZeroMap<'data, PotentialUtf8, str>
Symbol data for era narrow forms.
Keys are era codes, and values are display names. See Eras
.
Trait Implementations§
source§impl<'de: 'data, 'data> Deserialize<'de> for Eras<'data>
impl<'de: 'data, 'data> Deserialize<'de> for Eras<'data>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> Yokeable<'a> for Eras<'static>
impl<'a> Yokeable<'a> for Eras<'static>
source§type Output = Eras<'a>
type Output = Eras<'a>
This type MUST be
Self
with the 'static
replaced with 'a
, i.e. Self<'a>
source§fn transform_owned(self) -> Self::Output
fn transform_owned(self) -> Self::Output
source§unsafe fn make(this: Self::Output) -> Self
unsafe fn make(this: Self::Output) -> Self
This method can be used to cast away
Self<'a>
’s lifetime. Read moresource§fn transform_mut<F>(&'a mut self, f: F)where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
fn transform_mut<F>(&'a mut self, f: F)where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
This method must cast
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read moreimpl<'data> StructuralPartialEq for Eras<'data>
Auto Trait Implementations§
impl<'data> Freeze for Eras<'data>
impl<'data> RefUnwindSafe for Eras<'data>
impl<'data> Send for Eras<'data>
impl<'data> Sync for Eras<'data>
impl<'data> Unpin for Eras<'data>
impl<'data> UnwindSafe for Eras<'data>
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