pub struct DateTimeNotRepresentable { /* private fields */ }Expand description
Occurs if a DateTime is not representable as a Timestamp.
See Timestamp::MAX_REPRESENTABLE_DATE_TIME and Timestamp::MIN_REPRESENTABLE_DATE_TIME
for the latest and the earliest DateTime respectively that can be represented as a
Timestamp.
use leap_seconds::{
Date, DateTime, Time, Timestamp,
errors::DateTimeNotRepresentable,
};
let date_time = DateTime {
date: Date::new(1234, 5, 6)?,
time: Time::new(7, 8, 9)?,
};
let error: DateTimeNotRepresentable = Timestamp::from_date_time(date_time).unwrap_err();
assert_eq!(error.date_time(), date_time);Implementations§
Trait Implementations§
Source§impl Clone for DateTimeNotRepresentable
impl Clone for DateTimeNotRepresentable
Source§fn clone(&self) -> DateTimeNotRepresentable
fn clone(&self) -> DateTimeNotRepresentable
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 DateTimeNotRepresentable
impl Debug for DateTimeNotRepresentable
Source§impl Display for DateTimeNotRepresentable
impl Display for DateTimeNotRepresentable
Source§impl Error for DateTimeNotRepresentable
impl Error for DateTimeNotRepresentable
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 DateTimeNotRepresentable
impl PartialEq for DateTimeNotRepresentable
impl Eq for DateTimeNotRepresentable
impl StructuralPartialEq for DateTimeNotRepresentable
Auto Trait Implementations§
impl Freeze for DateTimeNotRepresentable
impl RefUnwindSafe for DateTimeNotRepresentable
impl Send for DateTimeNotRepresentable
impl Sync for DateTimeNotRepresentable
impl Unpin for DateTimeNotRepresentable
impl UnwindSafe for DateTimeNotRepresentable
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