pub struct Duration(/* private fields */);
Expand description
Algebraic (signed) durations
Represents a span of wall-clock time, the difference between two instants. May be negative to represent going backwards in time.
Implementations§
Source§impl Duration
impl Duration
Sourcepub const NANOSECOND: Self
pub const NANOSECOND: Self
One nanosecond, i.e. one billionth of a second
Sourcepub const MICROSECOND: Self
pub const MICROSECOND: Self
One microsecond, i.e. one millionth of a second
Sourcepub const MILLISECOND: Self
pub const MILLISECOND: Self
One millisecond, i.e. one thousandth of a second
Sourcepub const fn from_nanos(nanos: i64) -> Self
pub const fn from_nanos(nanos: i64) -> Self
Create a new Duration from a number of nanoseconds
Trait Implementations§
Source§impl AddAssign<Duration> for Instant
impl AddAssign<Duration> for Instant
Source§fn add_assign(&mut self, other: Duration)
fn add_assign(&mut self, other: Duration)
Performs the
+=
operation. Read moreSource§impl AddAssign for Duration
impl AddAssign for Duration
Source§fn add_assign(&mut self, other: Duration)
fn add_assign(&mut self, other: Duration)
Performs the
+=
operation. Read moreSource§impl DivAssign<i64> for Duration
impl DivAssign<i64> for Duration
Source§fn div_assign(&mut self, other: i64)
fn div_assign(&mut self, other: i64)
Performs the
/=
operation. Read moreSource§impl MulAssign<i64> for Duration
impl MulAssign<i64> for Duration
Source§fn mul_assign(&mut self, other: i64)
fn mul_assign(&mut self, other: i64)
Performs the
*=
operation. Read moreSource§impl Ord for Duration
impl Ord for Duration
Source§impl PartialOrd for Duration
impl PartialOrd for Duration
Source§impl SubAssign<Duration> for Instant
impl SubAssign<Duration> for Instant
Source§fn sub_assign(&mut self, other: Duration)
fn sub_assign(&mut self, other: Duration)
Performs the
-=
operation. Read moreSource§impl SubAssign for Duration
impl SubAssign for Duration
Source§fn sub_assign(&mut self, other: Duration)
fn sub_assign(&mut self, other: Duration)
Performs the
-=
operation. Read moreimpl Copy for Duration
impl Eq for Duration
impl StructuralPartialEq for Duration
Auto Trait Implementations§
impl Freeze for Duration
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