pub struct Day(/* private fields */);Expand description
A validated Advent of Code day, always within 1..=25.
The upper bound is the widest range any event has had; which days a
particular event has is Year::has_day, enforced by Puzzle::new.
Implementations§
Source§impl Day
impl Day
Sourcepub const LAST_SHORT: Self
pub const LAST_SHORT: Self
The last puzzle day from Year::FIRST_SHORT on.
Sourcepub const fn clamped(year: Year, day: u32) -> Self
pub const fn clamped(year: Year, day: u32) -> Self
Clamps an arbitrary calendar day into the year’s puzzle range.
December has 31 days but only 25 puzzles - 12 from
Year::FIRST_SHORT on - so anything past the end clamps to the last
day of that event.
Trait Implementations§
impl Copy for Day
impl Eq for Day
Source§impl Ord for Day
impl Ord for Day
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 PartialOrd for Day
impl PartialOrd for Day
impl StructuralPartialEq for Day
Auto Trait Implementations§
impl Freeze for Day
impl RefUnwindSafe for Day
impl Send for Day
impl Sync for Day
impl Unpin for Day
impl UnsafeUnpin for Day
impl UnwindSafe for Day
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.