pub struct Duration(/* private fields */);Expand description
Represents a duration of simulation time.
Implementations§
Source§impl Duration
impl Duration
Sourcepub const fn as_time_tick(self) -> TimeTick
pub const fn as_time_tick(self) -> TimeTick
Returns the underlying tick count.
Sourcepub fn checked_add(self, rhs: Duration) -> Option<Duration>
pub fn checked_add(self, rhs: Duration) -> Option<Duration>
Checked addition of another Duration.
Sourcepub fn saturating_add(self, rhs: Duration) -> Duration
pub fn saturating_add(self, rhs: Duration) -> Duration
Saturating addition of another Duration.
Sourcepub fn checked_sub(self, rhs: Duration) -> Option<Duration>
pub fn checked_sub(self, rhs: Duration) -> Option<Duration>
Checked subtraction of another Duration.
Sourcepub fn saturating_sub(self, rhs: Duration) -> Duration
pub fn saturating_sub(self, rhs: Duration) -> Duration
Saturating subtraction of another Duration.
Trait Implementations§
Source§impl Add<Duration> for PendingDuration
impl Add<Duration> for PendingDuration
Source§impl AddAssign<Duration> for SimTime
impl AddAssign<Duration> for SimTime
Source§fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the
+= operation. Read moreSource§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 From<Duration> for PendingDuration
impl From<Duration> for PendingDuration
Source§impl Ord for Duration
impl Ord for Duration
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Duration
impl PartialOrd for Duration
Source§impl Sub<Duration> for PendingDuration
impl Sub<Duration> for PendingDuration
Source§impl SubAssign for Duration
impl SubAssign for Duration
Source§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 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 UnsafeUnpin 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