Enum chrono::RoundingError [−][src]
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 Clone for RoundingError
[src]fn clone(&self) -> RoundingError
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Error for RoundingError
[src]
impl Error for RoundingError
[src]impl PartialEq<RoundingError> for RoundingError
[src]
impl PartialEq<RoundingError> for RoundingError
[src]