pub struct SimTime { /* private fields */ }Expand description
Simulation time representation.
Uses a fixed-point representation for reproducibility across platforms. Internal representation is in nanoseconds to avoid floating-point issues.
Implementations§
Source§impl SimTime
impl SimTime
Sourcepub const fn from_nanos(nanos: u64) -> Self
pub const fn from_nanos(nanos: u64) -> Self
Create time from nanoseconds.
Sourcepub fn as_secs_f64(&self) -> f64
pub fn as_secs_f64(&self) -> f64
Get time as seconds (f64).
Sourcepub const fn saturating_sub_nanos(self, nanos: u64) -> Self
pub const fn saturating_sub_nanos(self, nanos: u64) -> Self
Subtract duration from time, saturating at zero.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SimTime
impl<'de> Deserialize<'de> for SimTime
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for SimTime
impl Ord for SimTime
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ValidateIp for Twhere
T: ToString,
impl<T> ValidateIp for Twhere
T: ToString,
Source§fn validate_ipv4(&self) -> bool
fn validate_ipv4(&self) -> bool
Validates whether the given string is an IP V4
Source§fn validate_ipv6(&self) -> bool
fn validate_ipv6(&self) -> bool
Validates whether the given string is an IP V6
Source§fn validate_ip(&self) -> bool
fn validate_ip(&self) -> bool
Validates whether the given string is an IP