[−][src]Enum chrono::RoundingError
pub enum RoundingError { DurationExceedsTimestamp, DurationExceedsLimit, TimestampExceedsLimit, }
An error from rounding by Duration
See: [DurationRound
]
Variants
Error when the Duration exceeds the Duration from or until the Unix epoch.
let dt = Utc.ymd(1970, 12, 12).and_hms(0, 0, 0); assert_eq!( dt.duration_round(Duration::days(365)), Err(RoundingError::DurationExceedsTimestamp), );
Error when Duration.num_nanoseconds
exceeds the limit.
let dt = Utc.ymd(2260, 12, 31).and_hms_nano(23, 59, 59, 1_75_500_000); assert_eq!( dt.duration_round(Duration::days(300 * 365)), Err(RoundingError::DurationExceedsLimit) );
Error when DateTime.timestamp_nanos
exceeds the limit.
let dt = Utc.ymd(2300, 12, 12).and_hms(0, 0, 0); assert_eq!(dt.duration_round(Duration::days(1)), Err(RoundingError::TimestampExceedsLimit),);
Trait Implementations
impl Clone for RoundingError
[src][+]
impl Copy for RoundingError
[src]
impl Debug for RoundingError
[src][+]
impl Display for RoundingError
[src][+]
impl Eq for RoundingError
[src]
impl Error for RoundingError
[src][+]
impl PartialEq<RoundingError> for RoundingError
[src][+]
impl StructuralEq for RoundingError
[src]
impl StructuralPartialEq for RoundingError
[src]
Auto Trait Implementations
impl RefUnwindSafe for RoundingError
impl Send for RoundingError
impl Sync for RoundingError
impl Unpin for RoundingError
impl UnwindSafe for RoundingError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src][+]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,