#[repr(C, packed(1))]pub struct PackedHijriYearInfo(pub u8, pub u8);
Expand description
The struct containing compiled Hijri YearInfo
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: .. months ] | [ ny offset ]
Where the New Year Offset is a signed offset from epoch + MEAN_SYNODIC_MONTH * year * 12
for the given
calendar. This number does not appear to be less than 2, however we use all remaining bits for it in case of drift
in the math.
The month lengths are stored as 1 = 30, 0 = 29 for each month including the leap month.
🚧 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
Trait Implementations§
Source§impl AsULE for PackedHijriYearInfo
impl AsULE for PackedHijriYearInfo
Source§type ULE = PackedHijriYearInfo
type ULE = PackedHijriYearInfo
The ULE type corresponding to
Self
. Read moreSource§fn to_unaligned(self) -> PackedHijriYearInfo
fn to_unaligned(self) -> PackedHijriYearInfo
Source§fn from_unaligned(other: PackedHijriYearInfo) -> PackedHijriYearInfo
fn from_unaligned(other: PackedHijriYearInfo) -> PackedHijriYearInfo
Source§impl Bake for PackedHijriYearInfo
impl Bake for PackedHijriYearInfo
Source§fn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
Source§impl BakeSize for PackedHijriYearInfo
impl BakeSize for PackedHijriYearInfo
Source§fn borrows_size(&self) -> usize
fn borrows_size(&self) -> usize
Returns the size
Source§impl Clone for PackedHijriYearInfo
impl Clone for PackedHijriYearInfo
Source§fn clone(&self) -> PackedHijriYearInfo
fn clone(&self) -> PackedHijriYearInfo
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 PackedHijriYearInfo
impl Debug for PackedHijriYearInfo
Source§impl<'de> Deserialize<'de> for PackedHijriYearInfo
impl<'de> Deserialize<'de> for PackedHijriYearInfo
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PackedHijriYearInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PackedHijriYearInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for PackedHijriYearInfo
impl Hash for PackedHijriYearInfo
Source§impl Ord for PackedHijriYearInfo
impl Ord for PackedHijriYearInfo
Source§fn cmp(&self, other: &PackedHijriYearInfo) -> Ordering
fn cmp(&self, other: &PackedHijriYearInfo) -> 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 PackedHijriYearInfo
impl PartialEq for PackedHijriYearInfo
Source§impl PartialOrd for PackedHijriYearInfo
impl PartialOrd for PackedHijriYearInfo
Source§impl Serialize for PackedHijriYearInfo
impl Serialize for PackedHijriYearInfo
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl ULE for PackedHijriYearInfo
impl ULE for PackedHijriYearInfo
Source§fn validate_bytes(bytes: &[u8]) -> Result<(), UleError>
fn validate_bytes(bytes: &[u8]) -> Result<(), UleError>
Validates a byte slice,
&[u8]
. Read moreSource§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 moreimpl Copy for PackedHijriYearInfo
impl Eq for PackedHijriYearInfo
impl StructuralPartialEq for PackedHijriYearInfo
Auto Trait Implementations§
impl Freeze for PackedHijriYearInfo
impl RefUnwindSafe for PackedHijriYearInfo
impl Send for PackedHijriYearInfo
impl Sync for PackedHijriYearInfo
impl Unpin for PackedHijriYearInfo
impl UnwindSafe for PackedHijriYearInfo
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