#[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 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§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