Skip to main content

YearNames

Enum YearNames 

Source
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 item has a stack size of 32 bytes on the stable toolchain at release date.

๐Ÿšง 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.

Variantsยง

ยง

FixedEras(VarZeroVec<'data, str>)

This calendar has a small, fixed set of eras.

See era_index for how this is keyed.

ยง

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.

ยง

Cyclic(VarZeroVec<'data, str>)

This calendar is cyclic (Chinese, Dangi), so it uses cyclic year names without any eras

Trait Implementationsยง

Sourceยง

impl<'data> Bake for YearNames<'data>

Sourceยง

fn bake(&self, env: &CrateEnv) -> TokenStream

Returns a TokenStream that would evaluate to self. Read more
Sourceยง

impl<'data> BakeSize for YearNames<'data>

Sourceยง

fn borrows_size(&self) -> usize

Returns the size
Sourceยง

impl<'data> Clone for YearNames<'data>

Sourceยง

fn clone(&self) -> YearNames<'data>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) ยท Sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl<'data> Debug for YearNames<'data>

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Sourceยง

impl<'de: 'data, 'data> Deserialize<'de> for YearNames<'data>

Sourceยง

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 MaybeAsVarULE for YearNames<'_>

Sourceยง

type EncodedStruct = [()]

The VarULE type for this data struct, or [()] if it cannot be represented as VarULE.
Sourceยง

impl MaybeEncodeAsVarULE for YearNames<'_>

Available on crate feature datagen only.
Sourceยง

type EncodeableStruct<'b> = &'b [()] where Self: 'b

The type returned by Self::maybe_as_encodeable.
Sourceยง

fn maybe_as_encodeable<'b>(&'b self) -> Option<Self::EncodeableStruct<'b>>

Returns something encodeable to the MaybeAsVarULE::EncodedStruct that represents this data struct, or None if the data struct does not support this representation.
Sourceยง

impl<'data> PartialEq for YearNames<'data>

Sourceยง

fn eq(&self, other: &YearNames<'data>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) ยท Sourceยง

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Sourceยง

impl Serialize for YearNames<'_>

Available on crate feature serde only.
Sourceยง

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Sourceยง

impl<'data> StructuralPartialEq for YearNames<'data>

Sourceยง

impl<'yoke> Yokeable<'yoke> for YearNames<'static>

Sourceยง

type Output = YearNames<'yoke>

This type MUST be Self with the 'static replaced with 'a, i.e. Self<'a>
Sourceยง

fn transform(&'yoke self) -> &'yoke Self::Output

This method must cast self between &'a Self<'static> and &'a Self<'a>. Read more
Sourceยง

fn transform_owned(self) -> Self::Output

This method must cast self between Self<'static> and Self<'a>. Read more
Sourceยง

unsafe fn make(from: Self::Output) -> Self

This method can be used to cast away Self<'a>โ€™s lifetime. Read more
Sourceยง

fn transform_mut<F>(&'yoke mut self, f: F)
where F: 'static + for<'_yoke> FnOnce(&'_yoke mut Self::Output),

This method must cast self between &'a mut Self<'static> and &'a mut Self<'a>, and pass it to f. Read more
Sourceยง

impl<'zf, 'zf_inner> ZeroFrom<'zf, YearNames<'zf_inner>> for YearNames<'zf>

Sourceยง

fn zero_from(this: &'zf YearNames<'zf_inner>) -> Self

Clone the other C into a struct that may retain references into C.

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> UnsafeUnpin for YearNames<'data>

ยง

impl<'data> UnwindSafe for YearNames<'data>

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dest: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Sourceยง

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Sourceยง

impl<T> ErasedDestructor for T
where T: 'static,

Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> IntoEither for T

Sourceยง

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 more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ“˜
where F: FnOnce(&Self) -> bool,

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
Sourceยง

impl<T> Serialize for T
where T: Serialize + ?Sized,

Sourceยง

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Sourceยง

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Sourceยง

impl<T> ToOwned for T
where T: Clone,

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.