#[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 ] | unusedWhere 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: u8Trait 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 duplicate 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 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 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 moreSource§fn as_byte_slice(slice: &[Self]) -> &[u8]
fn as_byte_slice(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,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 3 bytes