Struct ZonedArithmetic
struct ZonedArithmetic { ... }
Options for Timestamp::checked_add and Timestamp::checked_sub.
This type provides a way to ergonomically add one of a few different
duration types to a Timestamp.
The main way to construct values of this type is with its From trait
implementations:
From<Span> for ZonedArithmeticadds (or subtracts) the given span to the receiver timestamp.From<SignedDuration> for ZonedArithmeticadds (or subtracts) the given signed duration to the receiver timestamp.From<std::time::Duration> for ZonedArithmeticadds (or subtracts) the given unsigned duration to the receiver timestamp.
Example
use Duration;
use ;
let ts: Timestamp = "2024-02-28T00:00:00Z".parse?;
assert_eq!;
assert_eq!;
assert_eq!;
# Ok::
Implementations
impl Clone for ZonedArithmetic
fn clone(self: &Self) -> ZonedArithmetic
impl Copy for ZonedArithmetic
impl Debug for ZonedArithmetic
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Freeze for ZonedArithmetic
impl From for ZonedArithmetic
fn from(udur: UnsignedDuration) -> ZonedArithmetic
impl From for ZonedArithmetic
fn from(span: Span) -> ZonedArithmetic
impl From for ZonedArithmetic
fn from(sdur: SignedDuration) -> ZonedArithmetic
impl RefUnwindSafe for ZonedArithmetic
impl Send for ZonedArithmetic
impl Sync for ZonedArithmetic
impl Unpin for ZonedArithmetic
impl UnsafeUnpin for ZonedArithmetic
impl UnwindSafe for ZonedArithmetic
impl<'a> From for ZonedArithmetic
fn from(udur: &'a UnsignedDuration) -> ZonedArithmetic
impl<'a> From for ZonedArithmetic
fn from(span: &'a Span) -> ZonedArithmetic
impl<'a> From for ZonedArithmetic
fn from(sdur: &'a SignedDuration) -> ZonedArithmetic
impl<T> Any for ZonedArithmetic
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for ZonedArithmetic
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for ZonedArithmetic
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for ZonedArithmetic
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for ZonedArithmetic
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for ZonedArithmetic
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for ZonedArithmetic
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 ZonedArithmetic
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for ZonedArithmetic
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>