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