pub enum YearNames<'data> {
FixedEras(VarZeroVec<'data, str>),
VariableEras(VarZeroCow<'data, Tuple2VarULE<VarZeroSlice<PotentialUtf8>, VarZeroSlice<str>>>),
Cyclic(VarZeroVec<'data, str>),
}
Expand description
Names used for representing the year.
This uses a data marker attribute for length. The value is simply the number of
characters in the equivalent CLDR field syntax name, plus “s” for standalone contexts. For example,
“abbreviated” (e.g. MMM
) is 3
or 3s
depending on whether it is format or standalone
respectively.
The full list is:
- 3 is “abbreviated”
- 4 is “narrow”
- 5 is “wide”
- 6 is “short” (weekdays only)
📏 This item has a stack size of 32 bytes on the stable toolchain at release date.
Variants§
FixedEras(VarZeroVec<'data, str>)
This calendar has a small, fixed set of eras with numeric years, this stores the era names in chronological order.
See FormattableEra for a definition of what chronological order is in this context.
VariableEras(VarZeroCow<'data, Tuple2VarULE<VarZeroSlice<PotentialUtf8>, VarZeroSlice<str>>>)
This calendar has a variable set of eras with numeric years, this stores the era names mapped from era code to the name.
Only the Japanese calendars need this
Cyclic(VarZeroVec<'data, str>)
This calendar is cyclic (Chinese, Dangi), so it uses cyclic year names without any eras
Trait Implementations§
Source§impl<'data> BakeSize for YearNames<'data>
impl<'data> BakeSize for YearNames<'data>
Source§fn borrows_size(&self) -> usize
fn borrows_size(&self) -> usize
Source§impl<'de: 'data, 'data> Deserialize<'de> for YearNames<'data>
impl<'de: 'data, 'data> Deserialize<'de> for YearNames<'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>,
Source§impl MaybeAsVarULE for YearNames<'_>
impl MaybeAsVarULE for YearNames<'_>
Source§type EncodedStruct = [()]
type EncodedStruct = [()]
VarULE
] type for this data struct, or [()]
if it cannot be represented as [VarULE
].Source§impl MaybeEncodeAsVarULE for YearNames<'_>
impl MaybeEncodeAsVarULE for YearNames<'_>
Source§fn maybe_encode_as_varule(&self) -> Option<&Self::EncodedStruct>
fn maybe_encode_as_varule(&self) -> Option<&Self::EncodedStruct>
MaybeAsVarULE::EncodedStruct
] that represents this data struct,
or None
if the data struct does not support this representation.Source§impl<'a> Yokeable<'a> for YearNames<'static>
impl<'a> Yokeable<'a> for YearNames<'static>
Source§type Output = YearNames<'a>
type Output = YearNames<'a>
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
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),
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read moreimpl<'data> StructuralPartialEq for YearNames<'data>
Auto Trait Implementations§
impl<'data> Freeze for YearNames<'data>
impl<'data> RefUnwindSafe for YearNames<'data>
impl<'data> Send for YearNames<'data>
impl<'data> Sync for YearNames<'data>
impl<'data> Unpin for YearNames<'data>
impl<'data> UnwindSafe for YearNames<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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