pub struct TimeDiff { /* private fields */ }Expand description
Time difference can be negative, unlike std::time::Duration
Implementations§
Source§impl TimeDiff
impl TimeDiff
pub const fn from_nanos(nanos: i64) -> TimeDiff
pub const fn from_millis(millis: i64) -> TimeDiff
pub const fn from_secs(secs: i64) -> TimeDiff
pub const fn as_nanos(self) -> i64
pub const fn as_millis(self) -> i64
pub const fn as_seconds(self) -> i64
pub fn as_duration(self) -> Result<Duration, NegativetimeDiffError>
pub fn as_saturating_duration(self) -> Duration
Trait Implementations§
impl Copy for TimeDiff
impl Eq for TimeDiff
Source§impl Ord for TimeDiff
impl Ord for TimeDiff
1.21.0 (const: unstable) · 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 PartialOrd for TimeDiff
impl PartialOrd for TimeDiff
impl StructuralPartialEq for TimeDiff
Auto Trait Implementations§
impl Freeze for TimeDiff
impl RefUnwindSafe for TimeDiff
impl Send for TimeDiff
impl Sync for TimeDiff
impl Unpin for TimeDiff
impl UnsafeUnpin for TimeDiff
impl UnwindSafe for TimeDiff
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