pub struct SimTime(/* private fields */);Expand description
Represents a specific point in simulation time.
Implementations§
Source§impl SimTime
impl SimTime
Sourcepub const fn from_ticks(ticks: TimeTick) -> SimTime
pub const fn from_ticks(ticks: TimeTick) -> SimTime
Creates a new SimTime from the given number of ticks.
Sourcepub const fn zero() -> SimTime
pub const fn zero() -> SimTime
Returns a SimTime representing the beginning of the simulation (time zero).
Sourcepub const fn as_time_tick(self) -> TimeTick
pub const fn as_time_tick(self) -> TimeTick
Returns the underlying tick count.
Sourcepub const fn is_zero(self) -> bool
pub const fn is_zero(self) -> bool
Returns true if this SimTime is at the beginning of the simulation.
Sourcepub fn checked_add(self, rhs: Duration) -> Option<SimTime>
pub fn checked_add(self, rhs: Duration) -> Option<SimTime>
Checked addition of a Duration.
Sourcepub fn saturating_add(self, rhs: Duration) -> SimTime
pub fn saturating_add(self, rhs: Duration) -> SimTime
Saturating addition of a Duration.
Sourcepub fn checked_sub(self, rhs: SimTime) -> Option<Duration>
pub fn checked_sub(self, rhs: SimTime) -> Option<Duration>
Checked subtraction of another SimTime, resulting in a Duration.
Sourcepub fn saturating_sub(self, rhs: SimTime) -> Duration
pub fn saturating_sub(self, rhs: SimTime) -> Duration
Saturating subtraction of another SimTime, resulting in a Duration.
Sourcepub fn checked_sub_duration(self, rhs: Duration) -> Option<SimTime>
pub fn checked_sub_duration(self, rhs: Duration) -> Option<SimTime>
Checked subtraction of a Duration.
Sourcepub fn saturating_sub_duration(self, rhs: Duration) -> SimTime
pub fn saturating_sub_duration(self, rhs: Duration) -> SimTime
Saturating subtraction of a Duration.
Trait Implementations§
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 Ord for SimTime
impl Ord for SimTime
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 SimTime
impl PartialOrd for SimTime
impl Copy for SimTime
impl Eq for SimTime
impl StructuralPartialEq for SimTime
Auto Trait Implementations§
impl Freeze for SimTime
impl RefUnwindSafe for SimTime
impl Send for SimTime
impl Sync for SimTime
impl Unpin for SimTime
impl UnsafeUnpin for SimTime
impl UnwindSafe for SimTime
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