Struct local_clock::LocalClockDelta
source · pub struct LocalClockDelta { /* private fields */ }
Expand description
A delta between two LocalClockTime
instances.
Unlike std::time::Duration
, a LocalClockDelta
may be negative, as
unlike std::time::Instant
or std::time::SystemTime
, it’s perfectly
reasonable (and expected!) that LocalClock
returns a LocalClockTime
that is earlier than a previously returned LocalClockTime
(as would be
the case if a LocalClock
is re-programmed to an earlier time).
This type doesn’t expose a particularly “rich” API for working the the
contained time delta. Rather, consumers of this type are expected to us it
alongside an external time/date library (such as time
or chrono
) in
order to more easily manipulate the time delta.
Implementations§
Trait Implementations§
source§impl Add<LocalClockDelta> for LocalClockTime
impl Add<LocalClockDelta> for LocalClockTime
source§type Output = LocalClockTime
type Output = LocalClockTime
The resulting type after applying the
+
operator.source§impl Add for LocalClockDelta
impl Add for LocalClockDelta
source§impl Clone for LocalClockDelta
impl Clone for LocalClockDelta
source§fn clone(&self) -> LocalClockDelta
fn clone(&self) -> LocalClockDelta
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LocalClockDelta
impl Debug for LocalClockDelta
source§impl Default for LocalClockDelta
impl Default for LocalClockDelta
source§fn default() -> LocalClockDelta
fn default() -> LocalClockDelta
Returns the “default value” for a type. Read more
source§impl From<Duration> for LocalClockDelta
impl From<Duration> for LocalClockDelta
source§impl From<Duration> for LocalClockDelta
impl From<Duration> for LocalClockDelta
source§fn from(time_duration: Duration) -> LocalClockDelta
fn from(time_duration: Duration) -> LocalClockDelta
Converts to this type from the input type.
source§impl From<LocalClockDelta> for Duration
impl From<LocalClockDelta> for Duration
source§fn from(clock_duration: LocalClockDelta) -> Duration
fn from(clock_duration: LocalClockDelta) -> Duration
Converts to this type from the input type.
source§impl Hash for LocalClockDelta
impl Hash for LocalClockDelta
source§impl Inspect for LocalClockDelta
impl Inspect for LocalClockDelta
source§impl Ord for LocalClockDelta
impl Ord for LocalClockDelta
source§fn cmp(&self, other: &LocalClockDelta) -> Ordering
fn cmp(&self, other: &LocalClockDelta) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for LocalClockDelta
impl PartialEq for LocalClockDelta
source§impl PartialOrd for LocalClockDelta
impl PartialOrd for LocalClockDelta
source§impl Sub<LocalClockDelta> for LocalClockTime
impl Sub<LocalClockDelta> for LocalClockTime
source§type Output = LocalClockTime
type Output = LocalClockTime
The resulting type after applying the
-
operator.source§impl Sub for LocalClockDelta
impl Sub for LocalClockDelta
impl Copy for LocalClockDelta
impl Eq for LocalClockDelta
impl StructuralPartialEq for LocalClockDelta
Auto Trait Implementations§
impl Freeze for LocalClockDelta
impl RefUnwindSafe for LocalClockDelta
impl Send for LocalClockDelta
impl Sync for LocalClockDelta
impl Unpin for LocalClockDelta
impl UnwindSafe for LocalClockDelta
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)