#[repr(C, packed(1))]pub struct PackedIslamicYearInfo(pub u8, pub u8);
Expand description
The struct containing compiled Islamic 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 PackedIslamicYearInfo
impl AsULE for PackedIslamicYearInfo
sourceยงtype ULE = PackedIslamicYearInfo
type ULE = PackedIslamicYearInfo
The ULE type corresponding to
Self
. Read moresourceยงfn to_unaligned(self) -> PackedIslamicYearInfo
fn to_unaligned(self) -> PackedIslamicYearInfo
sourceยงfn from_unaligned(other: PackedIslamicYearInfo) -> PackedIslamicYearInfo
fn from_unaligned(other: PackedIslamicYearInfo) -> PackedIslamicYearInfo
sourceยงimpl Bake for PackedIslamicYearInfo
impl Bake for PackedIslamicYearInfo
sourceยงfn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
sourceยงimpl BakeSize for PackedIslamicYearInfo
impl BakeSize for PackedIslamicYearInfo
sourceยงfn borrows_size(&self) -> usize
fn borrows_size(&self) -> usize
Returns the size
sourceยงimpl Clone for PackedIslamicYearInfo
impl Clone for PackedIslamicYearInfo
sourceยงfn clone(&self) -> PackedIslamicYearInfo
fn clone(&self) -> PackedIslamicYearInfo
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 PackedIslamicYearInfo
impl Debug for PackedIslamicYearInfo
sourceยงimpl<'de> Deserialize<'de> for PackedIslamicYearInfo
impl<'de> Deserialize<'de> for PackedIslamicYearInfo
sourceยงfn deserialize<__D>(
__deserializer: __D,
) -> Result<PackedIslamicYearInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PackedIslamicYearInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceยงimpl Hash for PackedIslamicYearInfo
impl Hash for PackedIslamicYearInfo
sourceยงimpl Ord for PackedIslamicYearInfo
impl Ord for PackedIslamicYearInfo
sourceยงfn cmp(&self, other: &PackedIslamicYearInfo) -> Ordering
fn cmp(&self, other: &PackedIslamicYearInfo) -> 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 PackedIslamicYearInfo
impl PartialEq for PackedIslamicYearInfo
sourceยงimpl PartialOrd for PackedIslamicYearInfo
impl PartialOrd for PackedIslamicYearInfo
sourceยงimpl Serialize for PackedIslamicYearInfo
impl Serialize for PackedIslamicYearInfo
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 PackedIslamicYearInfo
impl ULE for PackedIslamicYearInfo
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 PackedIslamicYearInfo
impl Eq for PackedIslamicYearInfo
impl StructuralPartialEq for PackedIslamicYearInfo
Auto Trait Implementationsยง
impl Freeze for PackedIslamicYearInfo
impl RefUnwindSafe for PackedIslamicYearInfo
impl Send for PackedIslamicYearInfo
impl Sync for PackedIslamicYearInfo
impl Unpin for PackedIslamicYearInfo
impl UnwindSafe for PackedIslamicYearInfo
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