Enum chrono::RoundingError [−][src]
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]
fn clone(&self) -> RoundingError
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn description(&self) -> &str
[src]
pub fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl PartialEq<RoundingError> for RoundingError
[src]
fn eq(&self, other: &RoundingError) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
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,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,