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