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 more