#[repr(C)]pub struct EmulatedTime(/* private fields */);Expand description
An instant in time (analagous to core::time::Instant) in the Shadow simulation.
Implementations§
Source§impl EmulatedTime
 
impl EmulatedTime
Sourcepub const SIMULATION_START: Self
 
pub const SIMULATION_START: Self
The start time of the simulation - 00:00:00 UTC on 1 January, 2000.
Sourcepub const UNIX_EPOCH: Self
 
pub const UNIX_EPOCH: Self
The Unix epoch (00:00:00 UTC on 1 January 1970)
pub const MAX: Self
pub const MIN: Self
Sourcepub const fn from_c_emutime(val: CEmulatedTime) -> Option<Self>
 
pub const fn from_c_emutime(val: CEmulatedTime) -> Option<Self>
Get the instance corresponding to val SimulationTime units since the Unix Epoch.
Sourcepub const fn to_c_emutime(val: Option<Self>) -> CEmulatedTime
 
pub const fn to_c_emutime(val: Option<Self>) -> CEmulatedTime
Convert to number of SimulationTime units since the Unix Epoch.
Sourcepub fn from_abs_simtime(val: SimulationTime) -> Self
 
pub fn from_abs_simtime(val: SimulationTime) -> Self
Get the instant corresponding to val time units since the simulation began.
Sourcepub fn to_abs_simtime(self) -> SimulationTime
 
pub fn to_abs_simtime(self) -> SimulationTime
Convert to the SimulationTime since the simulation began.
Sourcepub fn duration_since(&self, earlier: &EmulatedTime) -> SimulationTime
 
pub fn duration_since(&self, earlier: &EmulatedTime) -> SimulationTime
Returns the duration since earlier, or panics if earlier is after self, or
if the difference can’t be represented as SimulationTime.
Sourcepub fn checked_duration_since(
    &self,
    earlier: &EmulatedTime,
) -> Option<SimulationTime>
 
pub fn checked_duration_since( &self, earlier: &EmulatedTime, ) -> Option<SimulationTime>
Returns the duration since earlier, or None if earlier is after self.
Sourcepub fn saturating_duration_since(
    &self,
    earlier: &EmulatedTime,
) -> SimulationTime
 
pub fn saturating_duration_since( &self, earlier: &EmulatedTime, ) -> SimulationTime
Returns the duration since earlier, or 0 if earlier is after self.
pub fn checked_add(&self, duration: SimulationTime) -> Option<EmulatedTime>
pub fn checked_sub(&self, duration: SimulationTime) -> Option<EmulatedTime>
pub fn saturating_add(&self, duration: SimulationTime) -> EmulatedTime
pub fn saturating_sub(&self, duration: SimulationTime) -> EmulatedTime
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 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 Clone for EmulatedTime
 
impl Clone for EmulatedTime
Source§fn clone(&self) -> EmulatedTime
 
fn clone(&self) -> EmulatedTime
Returns a duplicate 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 EmulatedTime
 
impl Debug for EmulatedTime
Source§impl Hash for EmulatedTime
 
impl Hash for EmulatedTime
Source§impl Instant for EmulatedTime
 
impl Instant for EmulatedTime
type Duration = SimulationTime
Source§fn duration_since(&self, earlier: Self) -> Self::Duration
 
fn duration_since(&self, earlier: Self) -> Self::Duration
Source§fn saturating_duration_since(&self, earlier: Self) -> Self::Duration
 
fn saturating_duration_since(&self, earlier: Self) -> Self::Duration
Source§fn checked_duration_since(&self, earlier: Self) -> Option<Self::Duration>
 
fn checked_duration_since(&self, earlier: Self) -> Option<Self::Duration>
Source§fn checked_add(&self, duration: Self::Duration) -> Option<Self>
 
fn checked_add(&self, duration: Self::Duration) -> Option<Self>
Source§fn checked_sub(&self, duration: Self::Duration) -> Option<Self>
 
fn checked_sub(&self, duration: Self::Duration) -> Option<Self>
Source§impl Ord for EmulatedTime
 
impl Ord for EmulatedTime
Source§fn cmp(&self, other: &EmulatedTime) -> Ordering
 
fn cmp(&self, other: &EmulatedTime) -> 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 EmulatedTime
 
impl PartialEq for EmulatedTime
Source§impl PartialOrd for EmulatedTime
 
impl PartialOrd for EmulatedTime
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 EmulatedTime
 
impl Sub for EmulatedTime
Source§type Output = SimulationTime
 
type Output = SimulationTime
The resulting type after applying the 
- operator.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 moreimpl Copy for EmulatedTime
impl Eq for EmulatedTime
impl StructuralPartialEq for EmulatedTime
Auto Trait Implementations§
impl Freeze for EmulatedTime
impl RefUnwindSafe for EmulatedTime
impl Send for EmulatedTime
impl Sync for EmulatedTime
impl Unpin for EmulatedTime
impl UnwindSafe for EmulatedTime
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