Struct gregorian::InvalidDayOfMonth
source · Expand description
The day is not valid for the year and month.
Fields
year: Year
month: Month
day: u8
Implementations
sourceimpl InvalidDayOfMonth
impl InvalidDayOfMonth
pub const fn check(year: Year, month: Month, day: u8) -> Result<(), Self>
sourcepub const fn next_valid(self) -> Date
pub const fn next_valid(self) -> Date
Get the next valid date.
This function returns the first day of the next month for the invalid date.
It does not add the excess days in the new month.
sourcepub const fn prev_valid(self) -> Date
pub const fn prev_valid(self) -> Date
Get the last valid date before the invalid date.
This function returns the last day of the current month for the invalid date.
Trait Implementations
sourceimpl Clone for InvalidDayOfMonth
impl Clone for InvalidDayOfMonth
sourcefn clone(&self) -> InvalidDayOfMonth
fn clone(&self) -> InvalidDayOfMonth
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for InvalidDayOfMonth
impl Debug for InvalidDayOfMonth
sourceimpl Display for InvalidDayOfMonth
impl Display for InvalidDayOfMonth
sourceimpl Error for InvalidDayOfMonth
impl Error for InvalidDayOfMonth
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
sourceimpl From<InvalidDayOfMonth> for InvalidDate
impl From<InvalidDayOfMonth> for InvalidDate
sourcefn from(other: InvalidDayOfMonth) -> Self
fn from(other: InvalidDayOfMonth) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<InvalidDayOfMonth> for InvalidDayOfMonth
impl PartialEq<InvalidDayOfMonth> for InvalidDayOfMonth
sourcefn eq(&self, other: &InvalidDayOfMonth) -> bool
fn eq(&self, other: &InvalidDayOfMonth) -> bool
impl Copy for InvalidDayOfMonth
impl Eq for InvalidDayOfMonth
impl StructuralEq for InvalidDayOfMonth
impl StructuralPartialEq for InvalidDayOfMonth
Auto Trait Implementations
impl RefUnwindSafe for InvalidDayOfMonth
impl Send for InvalidDayOfMonth
impl Sync for InvalidDayOfMonth
impl Unpin for InvalidDayOfMonth
impl UnwindSafe for InvalidDayOfMonth
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more