pub struct Duration { /* private fields */ }
Expand description
A relative amount of time.
Implementations§
§impl Duration
impl Duration
pub const ZERO: Duration = _
pub const fn from_micros(micros: u64) -> Duration
pub const fn from_micros(micros: u64) -> Duration
Create a new Duration
from a number of microseconds.
pub const fn from_millis(millis: u64) -> Duration
pub const fn from_millis(millis: u64) -> Duration
Create a new Duration
from a number of milliseconds.
pub const fn total_millis(&self) -> u64
pub const fn total_millis(&self) -> u64
The total number of milliseconds in this Duration
.
pub const fn total_micros(&self) -> u64
pub const fn total_micros(&self) -> u64
The total number of microseconds in this Duration
.
Trait Implementations§
§impl AddAssign for Duration
impl AddAssign for Duration
§fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the
+=
operation. Read more§impl DivAssign<u32> for Duration
impl DivAssign<u32> for Duration
§fn div_assign(&mut self, rhs: u32)
fn div_assign(&mut self, rhs: u32)
Performs the
/=
operation. Read more§impl MulAssign<u32> for Duration
impl MulAssign<u32> for Duration
§fn mul_assign(&mut self, rhs: u32)
fn mul_assign(&mut self, rhs: u32)
Performs the
*=
operation. Read more§impl Ord for Duration
impl Ord for Duration
§impl PartialOrd for Duration
impl PartialOrd for Duration
§fn partial_cmp(&self, other: &Duration) -> Option<Ordering>
fn partial_cmp(&self, other: &Duration) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl ShlAssign<u32> for Duration
impl ShlAssign<u32> for Duration
§fn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
Performs the
<<=
operation. Read more§impl ShrAssign<u32> for Duration
impl ShrAssign<u32> for Duration
§fn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
Performs the
>>=
operation. Read more§impl SubAssign for Duration
impl SubAssign for Duration
§fn sub_assign(&mut self, rhs: Duration)
fn sub_assign(&mut self, rhs: Duration)
Performs the
-=
operation. Read moreimpl Copy for Duration
impl Eq for Duration
impl StructuralEq for Duration
impl StructuralPartialEq for Duration
Auto Trait Implementations§
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnwindSafe for Duration
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