pub struct Year(/* private fields */);Expand description
Represents a 4-digit year, 2015 or later.
Implementations§
Source§impl Year
impl Year
pub const fn new(year: u16) -> Option<Self>
pub const fn to_u16(self) -> u16
Sourcepub const fn max_day(self) -> Day
pub const fn max_day(self) -> Day
Returns the maximum day for the given year.
§Examples
assert_eq!(Year::new_const::<2015>().max_day(), Day::new_const::<25>());
assert_eq!(Year::new_const::<2025>().max_day(), Day::new_const::<12>());pub fn days(self) -> impl Iterator<Item = Day>
Trait Implementations§
Source§impl Ord for Year
impl Ord for Year
Source§impl PartialOrd for Year
impl PartialOrd for Year
impl Copy for Year
impl Eq for Year
impl StructuralPartialEq for Year
Auto Trait Implementations§
impl Freeze for Year
impl RefUnwindSafe for Year
impl Send for Year
impl Sync for Year
impl Unpin for Year
impl UnwindSafe for Year
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