struct PackedHijriYearData(u16);Expand description
The struct containing compiled Hijri YearInfo
start_dayhas to be within 5 days of the start of the year of theTabularAlgorithm.month_lengths[n - 1]has either 6 or 7 long months.
Bit structure
Bit: F.........C B.............0
Value: [ start day ][ month lengths ]The start day is encoded as a signed offset from Self::mean_tabular_start_day. 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: u16Implementationsยง
Sourceยงimpl PackedHijriYearData
impl PackedHijriYearData
const fn try_new( extended_year: i32, month_lengths: [bool; 12], start_day: RataDie, ) -> Option<Self>
const fn new_unchecked( extended_year: i32, month_lengths: [bool; 12], start_day: RataDie, ) -> Self
fn new_year(self, extended_year: i32) -> RataDie
fn month_has_30_days(self, month: u8) -> bool
fn is_leap(self) -> bool
fn last_day_of_month(self, month: u8) -> u16
fn days_in_year(self) -> u16
const fn mean_tabular_start_day(extended_year: i32) -> RataDie
Trait Implementationsยง
Sourceยงimpl Clone for PackedHijriYearData
impl Clone for PackedHijriYearData
Sourceยงfn clone(&self) -> PackedHijriYearData
fn clone(&self) -> PackedHijriYearData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) ยท 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 PackedHijriYearData
impl Debug for PackedHijriYearData
Sourceยงimpl Hash for PackedHijriYearData
impl Hash for PackedHijriYearData
Sourceยงimpl Ord for PackedHijriYearData
impl Ord for PackedHijriYearData
Sourceยงfn cmp(&self, other: &PackedHijriYearData) -> Ordering
fn cmp(&self, other: &PackedHijriYearData) -> Ordering
1.21.0 (const: unstable) ยท 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 PackedHijriYearData
impl PartialEq for PackedHijriYearData
Sourceยงfn eq(&self, other: &PackedHijriYearData) -> bool
fn eq(&self, other: &PackedHijriYearData) -> bool
Tests for
self and other values to be equal, and is used by ==.Sourceยงimpl PartialOrd for PackedHijriYearData
impl PartialOrd for PackedHijriYearData
impl Copy for PackedHijriYearData
impl Eq for PackedHijriYearData
impl StructuralPartialEq for PackedHijriYearData
Auto Trait Implementationsยง
impl Freeze for PackedHijriYearData
impl RefUnwindSafe for PackedHijriYearData
impl Send for PackedHijriYearData
impl Sync for PackedHijriYearData
impl Unpin for PackedHijriYearData
impl UnsafeUnpin for PackedHijriYearData
impl UnwindSafe for PackedHijriYearData
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