#[repr(C)]pub struct SimulationTime(/* private fields */);
Implementations§
source§impl SimulationTime
impl SimulationTime
sourcepub const MAX: SimulationTime = _
pub const MAX: SimulationTime = _
Maximum value. Currently equivalent to SIMTIME_MAX to avoid surprises when interoperating with C, but could use Duration::MAX when the C types go away.
pub const ZERO: SimulationTime = _
pub const SECOND: SimulationTime = _
pub const MILLISECOND: SimulationTime = _
pub const MICROSECOND: SimulationTime = _
pub const NANOSECOND: SimulationTime = _
pub fn from_c_simtime(val: CSimulationTime) -> Option<Self>
pub fn to_c_simtime(val: Option<Self>) -> CSimulationTime
sourcepub const fn from_duration(val: Duration) -> Self
pub const fn from_duration(val: Duration) -> Self
Convert a Duration
to a SimulationTime
. This function exists as a const
alternative to SimulationTime::try_from(duration)
. May panic if the duration is too large.
pub fn is_zero(&self) -> bool
pub fn is_positive(&self) -> bool
pub fn as_secs(&self) -> u64
pub fn as_millis(&self) -> u64
pub fn as_micros(&self) -> u64
pub fn as_nanos(&self) -> u128
pub fn as_nanos_f64(&self) -> f64
pub fn checked_add(self, other: Self) -> Option<Self>
pub fn checked_sub(self, other: Self) -> Option<Self>
pub fn checked_mul(self, other: u64) -> Option<Self>
pub fn checked_div(self, other: u64) -> Option<Self>
pub fn checked_rem(self, other: Self) -> Option<Self>
pub fn saturating_add(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_mul(self, other: u64) -> Self
pub fn try_from_secs(s: u64) -> Option<Self>
pub fn from_secs(s: u64) -> Self
pub fn try_from_millis(s: u64) -> Option<Self>
pub fn from_millis(s: u64) -> Self
pub fn try_from_micros(s: u64) -> Option<Self>
pub fn from_micros(s: u64) -> Self
pub fn try_from_nanos(s: u64) -> Option<Self>
pub fn from_nanos(s: u64) -> Self
pub fn subsec_millis(&self) -> u32
pub fn subsec_micros(&self) -> u32
pub fn subsec_nanos(&self) -> u32
Trait Implementations§
source§impl Add<SimulationTime> for EmulatedTime
impl Add<SimulationTime> for EmulatedTime
source§type Output = EmulatedTime
type Output = EmulatedTime
The resulting type after applying the
+
operator.source§fn add(self, other: SimulationTime) -> Self
fn add(self, other: SimulationTime) -> Self
Performs the
+
operation. Read moresource§impl Add for SimulationTime
impl Add for SimulationTime
source§impl AddAssign<SimulationTime> for EmulatedTime
impl AddAssign<SimulationTime> for EmulatedTime
source§fn add_assign(&mut self, rhs: SimulationTime)
fn add_assign(&mut self, rhs: SimulationTime)
Performs the
+=
operation. Read moresource§impl AddAssign for SimulationTime
impl AddAssign for SimulationTime
source§fn add_assign(&mut self, rhs: SimulationTime)
fn add_assign(&mut self, rhs: SimulationTime)
Performs the
+=
operation. Read moresource§impl Clone for SimulationTime
impl Clone for SimulationTime
source§fn clone(&self) -> SimulationTime
fn clone(&self) -> SimulationTime
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SimulationTime
impl Debug for SimulationTime
source§impl Div<u32> for SimulationTime
impl Div<u32> for SimulationTime
source§impl DivAssign<u32> for SimulationTime
impl DivAssign<u32> for SimulationTime
source§fn div_assign(&mut self, rhs: u32)
fn div_assign(&mut self, rhs: u32)
Performs the
/=
operation. Read moresource§impl Duration for SimulationTime
impl Duration for SimulationTime
source§const NANOSECOND: Self = Self::NANOSECOND
const NANOSECOND: Self = Self::NANOSECOND
source§const MICROSECOND: Self = Self::MICROSECOND
const MICROSECOND: Self = Self::MICROSECOND
source§const MILLISECOND: Self = Self::MILLISECOND
const MILLISECOND: Self = Self::MILLISECOND
source§fn checked_add(self, rhs: Self) -> Option<Self>
fn checked_add(self, rhs: Self) -> Option<Self>
source§fn checked_div(self, rhs: u32) -> Option<Self>
fn checked_div(self, rhs: u32) -> Option<Self>
source§fn checked_mul(self, rhs: u32) -> Option<Self>
fn checked_mul(self, rhs: u32) -> Option<Self>
source§fn checked_sub(self, rhs: Self) -> Option<Self>
fn checked_sub(self, rhs: Self) -> Option<Self>
source§fn from_micros(micros: u64) -> Self
fn from_micros(micros: u64) -> Self
source§fn from_millis(millis: u64) -> Self
fn from_millis(millis: u64) -> Self
source§fn from_nanos(nanos: u64) -> Self
fn from_nanos(nanos: u64) -> Self
source§fn saturating_add(self, rhs: Self) -> Self
fn saturating_add(self, rhs: Self) -> Self
source§fn saturating_mul(self, rhs: u32) -> Self
fn saturating_mul(self, rhs: u32) -> Self
source§fn saturating_sub(self, rhs: Self) -> Self
fn saturating_sub(self, rhs: Self) -> Self
source§fn subsec_micros(&self) -> u32
fn subsec_micros(&self) -> u32
source§fn subsec_millis(&self) -> u32
fn subsec_millis(&self) -> u32
source§fn subsec_nanos(&self) -> u32
fn subsec_nanos(&self) -> u32
source§impl From<SimulationTime> for Duration
impl From<SimulationTime> for Duration
source§fn from(val: SimulationTime) -> Duration
fn from(val: SimulationTime) -> Duration
Converts to this type from the input type.
source§impl From<SimulationTime> for CSimulationTime
impl From<SimulationTime> for CSimulationTime
source§fn from(val: SimulationTime) -> CSimulationTime
fn from(val: SimulationTime) -> CSimulationTime
Converts to this type from the input type.
source§impl Hash for SimulationTime
impl Hash for SimulationTime
source§impl Mul<u32> for SimulationTime
impl Mul<u32> for SimulationTime
source§impl MulAssign<u32> for SimulationTime
impl MulAssign<u32> for SimulationTime
source§fn mul_assign(&mut self, rhs: u32)
fn mul_assign(&mut self, rhs: u32)
Performs the
*=
operation. Read moresource§impl Ord for SimulationTime
impl Ord for SimulationTime
source§fn cmp(&self, other: &SimulationTime) -> Ordering
fn cmp(&self, other: &SimulationTime) -> Ordering
1.21.0 · 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 PartialEq for SimulationTime
impl PartialEq for SimulationTime
source§impl PartialOrd for SimulationTime
impl PartialOrd for SimulationTime
source§impl Rem for SimulationTime
impl Rem for SimulationTime
source§type Output = SimulationTime
type Output = SimulationTime
The resulting type after applying the
%
operator.source§impl Sub<SimulationTime> for EmulatedTime
impl Sub<SimulationTime> for EmulatedTime
source§type Output = EmulatedTime
type Output = EmulatedTime
The resulting type after applying the
-
operator.source§fn sub(self, other: SimulationTime) -> Self
fn sub(self, other: SimulationTime) -> Self
Performs the
-
operation. Read moresource§impl Sub for SimulationTime
impl Sub for SimulationTime
source§impl SubAssign<SimulationTime> for EmulatedTime
impl SubAssign<SimulationTime> for EmulatedTime
source§fn sub_assign(&mut self, rhs: SimulationTime)
fn sub_assign(&mut self, rhs: SimulationTime)
Performs the
-=
operation. Read moresource§impl SubAssign for SimulationTime
impl SubAssign for SimulationTime
source§fn sub_assign(&mut self, rhs: SimulationTime)
fn sub_assign(&mut self, rhs: SimulationTime)
Performs the
-=
operation. Read moresource§impl TryFrom<Duration> for SimulationTime
impl TryFrom<Duration> for SimulationTime
source§impl TryFrom<SimulationTime> for timespec
impl TryFrom<SimulationTime> for timespec
source§impl TryFrom<SimulationTime> for timeval
impl TryFrom<SimulationTime> for timeval
source§impl TryFrom<SimulationTime> for timespec
impl TryFrom<SimulationTime> for timespec
source§impl TryFrom<SimulationTime> for timeval
impl TryFrom<SimulationTime> for timeval
source§impl TryFrom<linux_timespec> for SimulationTime
impl TryFrom<linux_timespec> for SimulationTime
source§impl TryFrom<linux_timeval> for SimulationTime
impl TryFrom<linux_timeval> for SimulationTime
source§impl TryFrom<timespec> for SimulationTime
impl TryFrom<timespec> for SimulationTime
source§impl TryFrom<timeval> for SimulationTime
impl TryFrom<timeval> for SimulationTime
impl Copy for SimulationTime
impl Eq for SimulationTime
impl StructuralPartialEq for SimulationTime
Auto Trait Implementations§
impl Freeze for SimulationTime
impl RefUnwindSafe for SimulationTime
impl Send for SimulationTime
impl Sync for SimulationTime
impl Unpin for SimulationTime
impl UnwindSafe for SimulationTime
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)