pub struct DateRangeError(/* private fields */);Expand description
The error type indicating that a Date was out of range.
Implementations§
Source§impl DateRangeError
impl DateRangeError
Sourcepub const fn kind(&self) -> DateRangeErrorKind
pub const fn kind(&self) -> DateRangeErrorKind
Returns the corresponding DateRangeErrorKind for this error.
§Examples
let err = Date::from_date(date!(1979-12-31)).unwrap_err();
assert_eq!(err.kind(), DateRangeErrorKind::Negative);
let err = Date::from_date(date!(2108-01-01)).unwrap_err();
assert_eq!(err.kind(), DateRangeErrorKind::Overflow);Trait Implementations§
Source§impl Clone for DateRangeError
impl Clone for DateRangeError
Source§fn clone(&self) -> DateRangeError
fn clone(&self) -> DateRangeError
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 DateRangeError
impl Debug for DateRangeError
Source§impl Display for DateRangeError
impl Display for DateRangeError
Source§impl Error for DateRangeError
impl Error for DateRangeError
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 From<DateRangeError> for DateTimeRangeError
impl From<DateRangeError> for DateTimeRangeError
Source§fn from(err: DateRangeError) -> Self
fn from(err: DateRangeError) -> Self
Converts to this type from the input type.
Source§impl From<DateRangeErrorKind> for DateRangeError
impl From<DateRangeErrorKind> for DateRangeError
Source§fn from(kind: DateRangeErrorKind) -> Self
fn from(kind: DateRangeErrorKind) -> Self
Converts to this type from the input type.
Source§impl PartialEq for DateRangeError
impl PartialEq for DateRangeError
impl Copy for DateRangeError
impl Eq for DateRangeError
impl StructuralPartialEq for DateRangeError
Auto Trait Implementations§
impl Freeze for DateRangeError
impl RefUnwindSafe for DateRangeError
impl Send for DateRangeError
impl Sync for DateRangeError
impl Unpin for DateRangeError
impl UnwindSafe for DateRangeError
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)