#[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 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_byte_slice(bytes: &[u8]) -> Result<(), ZeroVecError>
fn validate_byte_slice(bytes: &[u8]) -> Result<(), ZeroVecError>
Validates a byte slice,
&[u8]
. Read moreSourceยงfn parse_byte_slice(bytes: &[u8]) -> Result<&[Self], ZeroVecError>
fn parse_byte_slice(bytes: &[u8]) -> Result<&[Self], ZeroVecError>
Sourceยงunsafe fn from_byte_slice_unchecked(bytes: &[u8]) -> &[Self]
unsafe fn from_byte_slice_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_byte_slice()
with
success. Read moreimpl 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