pub struct Duration { /* private fields */ }
Expand description
Type-safe alias for time values representing an interval length.
Implementations§
Source§impl Duration
impl Duration
Sourcepub const fn is_non_zero(self) -> bool
pub const fn is_non_zero(self) -> bool
Check whether the duration represents a non-empty interval.
Sourcepub const fn epsilon() -> Duration
pub const fn epsilon() -> Duration
Construct a duration value that represents the smallest unit of time (i.e., 1).
Sourcepub const fn saturating_sub(&self, rhs: Duration) -> Duration
pub const fn saturating_sub(&self, rhs: Duration) -> Duration
Subtract without under-flowing.
Trait Implementations§
Source§impl AddAssign for Duration
impl AddAssign for Duration
Source§fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the
+=
operation. Read moreSource§impl FromIterator<Duration> for Curve
impl FromIterator<Duration> for Curve
Source§impl Ord for Duration
impl Ord for Duration
Source§impl PartialOrd for Duration
impl PartialOrd for Duration
impl 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more