pub struct Delta<U: TimeUnit = Nsec> { /* private fields */ }Expand description
Implementations§
Source§impl Delta<Jiffy>
impl Delta<Jiffy>
Sourcepub const fn from_jiffies(jiffies: isize) -> Self
pub const fn from_jiffies(jiffies: isize) -> Self
Create a new Delta from a number of jiffies.
Sourcepub const fn as_jiffies(self) -> isize
pub const fn as_jiffies(self) -> isize
Return the number of jiffies in the Delta.
Source§impl Delta
impl Delta
Sourcepub const fn from_nanos(nanos: i64) -> Self
pub const fn from_nanos(nanos: i64) -> Self
Create a new Delta from a number of nanoseconds.
Sourcepub const fn from_micros(micros: i64) -> Self
pub const fn from_micros(micros: i64) -> Self
Create a new Delta from a number of microseconds.
The micros can range from -9_223_372_036_854_775 to 9_223_372_036_854_775.
If micros is outside this range, i64::MIN is used for negative values,
and i64::MAX is used for positive values due to saturation.
Sourcepub const fn from_millis(millis: i64) -> Self
pub const fn from_millis(millis: i64) -> Self
Create a new Delta from a number of milliseconds.
The millis can range from -9_223_372_036_854 to 9_223_372_036_854.
If millis is outside this range, i64::MIN is used for negative values,
and i64::MAX is used for positive values due to saturation.
Sourcepub const fn from_secs(secs: i64) -> Self
pub const fn from_secs(secs: i64) -> Self
Create a new Delta from a number of seconds.
The secs can range from -9_223_372_036 to 9_223_372_036.
If secs is outside this range, i64::MIN is used for negative values,
and i64::MAX is used for positive values due to saturation.
Sourcepub fn is_negative(self) -> bool
pub fn is_negative(self) -> bool
Return true if the Delta spans a negative amount of time.
Sourcepub fn as_micros_ceil(self) -> i64
pub fn as_micros_ceil(self) -> i64
Return the smallest number of microseconds greater than or equal
to the value in the Delta.
Sourcepub fn as_millis_ceil(self) -> i64
pub fn as_millis_ceil(self) -> i64
Return the smallest number of milliseconds greater than or equal
to the value in the Delta.
Trait Implementations§
Source§impl AddAssign for Delta
impl AddAssign for Delta
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreimpl<U: Copy + TimeUnit> Copy for Delta<U>
impl<U: Eq + TimeUnit> Eq for Delta<U>
Source§impl HrTimerExpires for Delta
impl HrTimerExpires for Delta
Source§impl MulAssign<i64> for Delta
impl MulAssign<i64> for Delta
Source§fn mul_assign(&mut self, rhs: i64)
fn mul_assign(&mut self, rhs: i64)
*= operation. Read moreSource§impl<U: Ord + TimeUnit> Ord for Delta<U>
impl<U: Ord + TimeUnit> Ord for Delta<U>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<U: PartialOrd + TimeUnit> PartialOrd for Delta<U>where
U::Repr: PartialOrd,
impl<U: PartialOrd + TimeUnit> PartialOrd for Delta<U>where
U::Repr: PartialOrd,
impl<U: PartialEq + TimeUnit> StructuralPartialEq for Delta<U>
Auto Trait Implementations§
impl<U> Freeze for Delta<U>
impl<U> RefUnwindSafe for Delta<U>
impl<U> Send for Delta<U>
impl<U> Sync for Delta<U>
impl<U> Unpin for Delta<U>
impl<U> UnsafeUnpin for Delta<U>
impl<U> UnwindSafe for Delta<U>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
Source§fn into_safe_cast(self) -> T
fn into_safe_cast(self) -> T
self into a T. This operation is guaranteed to be lossless.Source§impl<S, T> IntoSafeCastArch<T> for Swhere
T: FromSafeCastArch<S>,
impl<S, T> IntoSafeCastArch<T> for Swhere
T: FromSafeCastArch<S>,
Source§fn into_safe_cast_arch(self) -> T
fn into_safe_cast_arch(self) -> T
self into a T. This operation is guaranteed to be lossless.