Struct DateTimeArithmetic
struct DateTimeArithmetic { ... }
Options for DateTime::checked_add and DateTime::checked_sub.
This type provides a way to ergonomically add one of a few different
duration types to a DateTime.
The main way to construct values of this type is with its From trait
implementations:
From<Span> for DateTimeArithmeticadds (or subtracts) the given span to the receiver datetime.From<SignedDuration> for DateTimeArithmeticadds (or subtracts) the given signed duration to the receiver datetime.From<std::time::Duration> for DateTimeArithmeticadds (or subtracts) the given unsigned duration to the receiver datetime.
Example
use Duration;
use ;
let dt = date.at;
assert_eq!;
assert_eq!;
assert_eq!;
# Ok::
Implementations
impl Clone for DateTimeArithmetic
fn clone(self: &Self) -> DateTimeArithmetic
impl Copy for DateTimeArithmetic
impl Debug for DateTimeArithmetic
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Freeze for DateTimeArithmetic
impl From for DateTimeArithmetic
fn from(span: Span) -> DateTimeArithmetic
impl From for DateTimeArithmetic
fn from(sdur: SignedDuration) -> DateTimeArithmetic
impl From for DateTimeArithmetic
fn from(udur: UnsignedDuration) -> DateTimeArithmetic
impl RefUnwindSafe for DateTimeArithmetic
impl Send for DateTimeArithmetic
impl Sync for DateTimeArithmetic
impl Unpin for DateTimeArithmetic
impl UnsafeUnpin for DateTimeArithmetic
impl UnwindSafe for DateTimeArithmetic
impl<'a> From for DateTimeArithmetic
fn from(span: &'a Span) -> DateTimeArithmetic
impl<'a> From for DateTimeArithmetic
fn from(sdur: &'a SignedDuration) -> DateTimeArithmetic
impl<'a> From for DateTimeArithmetic
fn from(udur: &'a UnsignedDuration) -> DateTimeArithmetic
impl<T> Any for DateTimeArithmetic
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for DateTimeArithmetic
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for DateTimeArithmetic
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for DateTimeArithmetic
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for DateTimeArithmetic
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for DateTimeArithmetic
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for DateTimeArithmetic
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for DateTimeArithmetic
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for DateTimeArithmetic
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>