pub struct CalendarDate {
pub year: i32,
pub month: u32,
pub day: u32,
}Expand description
A Gregorian calendar date with year, month (1..=12), and day (1..=31).
Fields§
§year: i32§month: u32§day: u32Implementations§
Source§impl CalendarDate
impl CalendarDate
Sourcepub const fn new(year: i32, month: u32, day: u32) -> Self
pub const fn new(year: i32, month: u32, day: u32) -> Self
Creates a calendar date without validating bounds.
Sourcepub const fn is_leap_year(year: i32) -> bool
pub const fn is_leap_year(year: i32) -> bool
Returns true if year is a leap year in the Gregorian calendar.
Sourcepub const fn days_in_month(year: i32, month: u32) -> u32
pub const fn days_in_month(year: i32, month: u32) -> u32
Returns the number of days in month for year.
Trait Implementations§
Source§impl Clone for CalendarDate
impl Clone for CalendarDate
impl Copy for CalendarDate
Source§impl Debug for CalendarDate
impl Debug for CalendarDate
impl Eq for CalendarDate
Source§impl Hash for CalendarDate
impl Hash for CalendarDate
Source§impl Ord for CalendarDate
impl Ord for CalendarDate
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for CalendarDate
impl PartialEq for CalendarDate
Source§impl PartialOrd for CalendarDate
impl PartialOrd for CalendarDate
impl StructuralPartialEq for CalendarDate
Auto Trait Implementations§
impl Forget for CalendarDate
impl Freeze for CalendarDate
impl Move for CalendarDate
impl RefUnwindSafe for CalendarDate
impl Send for CalendarDate
impl Sync for CalendarDate
impl Unpin for CalendarDate
impl UnsafeUnpin for CalendarDate
impl UnwindSafe for CalendarDate
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