pub enum InvalidDate {
MonthOutOfRange(u8),
DayOutOfRange(u8),
}Expand description
Indicates an attempt to create an invalid Date.
use leap_seconds::{Date, InvalidDate};
// November only has 30 days
let error = Date::new(2000, 11, 31);
assert_eq!(error, Err(InvalidDate::DayOutOfRange(31)));Variants§
MonthOutOfRange(u8)
Indicates that the day was out of range.
DayOutOfRange(u8)
Indicates that the month was out of range.
Trait Implementations§
Source§impl Clone for InvalidDate
impl Clone for InvalidDate
Source§fn clone(&self) -> InvalidDate
fn clone(&self) -> InvalidDate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InvalidDate
impl Debug for InvalidDate
Source§impl Display for InvalidDate
impl Display for InvalidDate
Source§impl Error for InvalidDate
impl Error for InvalidDate
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for InvalidDate
impl PartialEq for InvalidDate
impl Eq for InvalidDate
impl StructuralPartialEq for InvalidDate
Auto Trait Implementations§
impl Freeze for InvalidDate
impl RefUnwindSafe for InvalidDate
impl Send for InvalidDate
impl Sync for InvalidDate
impl Unpin for InvalidDate
impl UnwindSafe for InvalidDate
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