#[repr(C, packed(1))]pub struct PackedChineseBasedYearInfo(pub u8, pub u8, pub u8);
Expand description
The struct containing compiled ChineseData
Bit structure (little endian: note that shifts go in the opposite direction!)
Bit: 0 1 2 3 4 5 6 7
Byte 0: [ month lengths .............
Byte 1: .. month lengths ] | [ leap month index ..
Byte 2: ] | [ NY offset ] | unused
Where the New Year Offset is the offset from ISO Jan 21 of that year for Chinese New Year, the month lengths are stored as 1 = 30, 0 = 29 for each month including the leap month. The largest possible offset is 33, which requires 6 bits of storage.
๐ง 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.
Tuple Fieldsยง
ยง0: u8
ยง1: u8
ยง2: u8
Trait Implementationsยง
sourceยงimpl AsULE for PackedChineseBasedYearInfo
impl AsULE for PackedChineseBasedYearInfo
sourceยงtype ULE = PackedChineseBasedYearInfo
type ULE = PackedChineseBasedYearInfo
The ULE type corresponding to
Self
. Read moresourceยงfn to_unaligned(self) -> Self
fn to_unaligned(self) -> Self
sourceยงfn from_unaligned(other: Self) -> Self
fn from_unaligned(other: Self) -> Self
sourceยงimpl Bake for PackedChineseBasedYearInfo
impl Bake for PackedChineseBasedYearInfo
sourceยงfn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
sourceยงimpl BakeSize for PackedChineseBasedYearInfo
impl BakeSize for PackedChineseBasedYearInfo
sourceยงfn borrows_size(&self) -> usize
fn borrows_size(&self) -> usize
Returns the size
sourceยงimpl Clone for PackedChineseBasedYearInfo
impl Clone for PackedChineseBasedYearInfo
sourceยงfn clone(&self) -> PackedChineseBasedYearInfo
fn clone(&self) -> PackedChineseBasedYearInfo
Returns a copy of the value. Read more
1.0.0 ยท sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceยงimpl Debug for PackedChineseBasedYearInfo
impl Debug for PackedChineseBasedYearInfo
sourceยงimpl<'de> Deserialize<'de> for PackedChineseBasedYearInfo
impl<'de> Deserialize<'de> for PackedChineseBasedYearInfo
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 Ord for PackedChineseBasedYearInfo
impl Ord for PackedChineseBasedYearInfo
sourceยงfn cmp(&self, other: &PackedChineseBasedYearInfo) -> Ordering
fn cmp(&self, other: &PackedChineseBasedYearInfo) -> Ordering
1.21.0 ยท sourceยงfn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
sourceยงimpl PartialEq for PackedChineseBasedYearInfo
impl PartialEq for PackedChineseBasedYearInfo
sourceยงfn eq(&self, other: &PackedChineseBasedYearInfo) -> bool
fn eq(&self, other: &PackedChineseBasedYearInfo) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.sourceยงimpl PartialOrd for PackedChineseBasedYearInfo
impl PartialOrd for PackedChineseBasedYearInfo
sourceยงimpl ULE for PackedChineseBasedYearInfo
impl ULE for PackedChineseBasedYearInfo
sourceยงfn validate_bytes(bytes: &[u8]) -> Result<(), UleError>
fn validate_bytes(bytes: &[u8]) -> Result<(), UleError>
Validates a byte slice,
&[u8]
. Read moreยงfn parse_bytes_to_slice(bytes: &[u8]) -> Result<&[Self], UleError>
fn parse_bytes_to_slice(bytes: &[u8]) -> Result<&[Self], UleError>
ยงunsafe fn slice_from_bytes_unchecked(bytes: &[u8]) -> &[Self]
unsafe fn slice_from_bytes_unchecked(bytes: &[u8]) -> &[Self]
Takes a byte slice,
&[u8]
, and return it as &[Self]
with the same lifetime, assuming
that this byte slice has previously been run through [Self::parse_bytes_to_slice()
] with
success. Read moreยงfn slice_as_bytes(slice: &[Self]) -> &[u8] โ
fn slice_as_bytes(slice: &[Self]) -> &[u8] โ
impl Copy for PackedChineseBasedYearInfo
impl Eq for PackedChineseBasedYearInfo
impl StructuralPartialEq for PackedChineseBasedYearInfo
Auto Trait Implementationsยง
impl Freeze for PackedChineseBasedYearInfo
impl RefUnwindSafe for PackedChineseBasedYearInfo
impl Send for PackedChineseBasedYearInfo
impl Sync for PackedChineseBasedYearInfo
impl Unpin for PackedChineseBasedYearInfo
impl UnwindSafe for PackedChineseBasedYearInfo
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