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