pub struct YearFlags(pub(super) u8);
Expand description
Year flags (aka the dominical letter).
YearFlags
are used as the last four bits of NaiveDate
, Mdf
and IsoWeek
.
There are 14 possible classes of year in the Gregorian calendar: common and leap years starting with Monday through Sunday.
The YearFlags
stores this information into 4 bits LWWW
. L
is the leap year flag, with 1
for the common year (this simplifies validating an ordinal in NaiveDate
). WWW
is a non-zero
Weekday
of the last day in the preceding year.
Tuple Fields§
§0: u8
Implementations§
Trait Implementations§
source§impl PartialEq for YearFlags
impl PartialEq for YearFlags
impl Copy for YearFlags
impl Eq for YearFlags
impl StructuralPartialEq for YearFlags
Auto Trait Implementations§
impl Freeze for YearFlags
impl RefUnwindSafe for YearFlags
impl Send for YearFlags
impl Sync for YearFlags
impl Unpin for YearFlags
impl UnwindSafe for YearFlags
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