pub struct InvalidDate {
pub year: Option<u16>,
pub month: u8,
pub day: u8,
}Expand description
Error for when a date cannot exist in reality - such as 2009-02-31.
use chinese_format::gregorian::*;
assert_eq!(
InvalidDate {
year: None,
month: 2,
day: 31
}.to_string(),
"Invalid date: 2-31"
);
assert_eq!(
InvalidDate {
year: Some(1986),
month: 2,
day: 31
}.to_string(),
"Invalid date: 1986-2-31"
);Fields§
§year: Option<u16>§month: u8§day: u8Trait 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§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§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§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl Hash for InvalidDate
impl Hash for InvalidDate
Source§impl Ord for InvalidDate
impl Ord for InvalidDate
Source§impl PartialEq for InvalidDate
impl PartialEq for InvalidDate
Source§impl PartialOrd for InvalidDate
impl PartialOrd for InvalidDate
impl Copy 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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)