shadow_shim_helper_rs::simulation_time

Struct SimulationTime

source
#[repr(C)]
pub struct SimulationTime(/* private fields */);

Implementations§

source§

impl SimulationTime

source

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.

source

pub const ZERO: SimulationTime = _

source

pub const SECOND: SimulationTime = _

source

pub const MILLISECOND: SimulationTime = _

source

pub const MICROSECOND: SimulationTime = _

source

pub const NANOSECOND: SimulationTime = _

source

pub fn from_c_simtime(val: CSimulationTime) -> Option<Self>

source

pub fn to_c_simtime(val: Option<Self>) -> CSimulationTime

source

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.

source

pub fn is_zero(&self) -> bool

source

pub fn is_positive(&self) -> bool

source

pub fn as_secs(&self) -> u64

source

pub fn as_millis(&self) -> u64

source

pub fn as_micros(&self) -> u64

source

pub fn as_nanos(&self) -> u128

source

pub fn as_nanos_f64(&self) -> f64

source

pub fn checked_add(self, other: Self) -> Option<Self>

source

pub fn checked_sub(self, other: Self) -> Option<Self>

source

pub fn checked_mul(self, other: u64) -> Option<Self>

source

pub fn checked_div(self, other: u64) -> Option<Self>

source

pub fn checked_rem(self, other: Self) -> Option<Self>

source

pub fn saturating_add(self, other: Self) -> Self

source

pub fn saturating_sub(self, other: Self) -> Self

source

pub fn saturating_mul(self, other: u64) -> Self

source

pub fn try_from_secs(s: u64) -> Option<Self>

source

pub fn from_secs(s: u64) -> Self

source

pub fn try_from_millis(s: u64) -> Option<Self>

source

pub fn from_millis(s: u64) -> Self

source

pub fn try_from_micros(s: u64) -> Option<Self>

source

pub fn from_micros(s: u64) -> Self

source

pub fn try_from_nanos(s: u64) -> Option<Self>

source

pub fn from_nanos(s: u64) -> Self

source

pub fn subsec_millis(&self) -> u32

source

pub fn subsec_micros(&self) -> u32

source

pub fn subsec_nanos(&self) -> u32

Trait Implementations§

source§

impl Add<SimulationTime> for EmulatedTime

source§

type Output = EmulatedTime

The resulting type after applying the + operator.
source§

fn add(self, other: SimulationTime) -> Self

Performs the + operation. Read more
source§

impl Add for SimulationTime

source§

type Output = SimulationTime

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Self::Output

Performs the + operation. Read more
source§

impl AddAssign<SimulationTime> for EmulatedTime

source§

fn add_assign(&mut self, rhs: SimulationTime)

Performs the += operation. Read more
source§

impl AddAssign for SimulationTime

source§

fn add_assign(&mut self, rhs: SimulationTime)

Performs the += operation. Read more
source§

impl Clone for SimulationTime

source§

fn clone(&self) -> SimulationTime

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SimulationTime

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Div<u32> for SimulationTime

source§

type Output = SimulationTime

The resulting type after applying the / operator.
source§

fn div(self, other: u32) -> Self::Output

Performs the / operation. Read more
source§

impl DivAssign<u32> for SimulationTime

source§

fn div_assign(&mut self, rhs: u32)

Performs the /= operation. Read more
source§

impl Duration for SimulationTime

source§

const MAX: Self = Self::MAX

source§

const NANOSECOND: Self = Self::NANOSECOND

source§

const MICROSECOND: Self = Self::MICROSECOND

source§

const MILLISECOND: Self = Self::MILLISECOND

source§

const SECOND: Self = Self::SECOND

source§

const ZERO: Self = Self::ZERO

source§

fn as_micros(&self) -> u128

source§

fn as_millis(&self) -> u128

source§

fn as_nanos(&self) -> u128

source§

fn as_secs(&self) -> u64

source§

fn checked_add(self, rhs: Self) -> Option<Self>

source§

fn checked_div(self, rhs: u32) -> Option<Self>

source§

fn checked_mul(self, rhs: u32) -> Option<Self>

source§

fn checked_sub(self, rhs: Self) -> Option<Self>

source§

fn from_micros(micros: u64) -> Self

source§

fn from_millis(millis: u64) -> Self

source§

fn from_nanos(nanos: u64) -> Self

source§

fn from_secs(secs: u64) -> Self

source§

fn is_zero(&self) -> bool

source§

fn saturating_add(self, rhs: Self) -> Self

source§

fn saturating_mul(self, rhs: u32) -> Self

source§

fn saturating_sub(self, rhs: Self) -> Self

source§

fn subsec_micros(&self) -> u32

source§

fn subsec_millis(&self) -> u32

source§

fn subsec_nanos(&self) -> u32

source§

impl From<SimulationTime> for Duration

source§

fn from(val: SimulationTime) -> Duration

Converts to this type from the input type.
source§

impl From<SimulationTime> for CSimulationTime

source§

fn from(val: SimulationTime) -> CSimulationTime

Converts to this type from the input type.
source§

impl Hash for SimulationTime

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Mul<u32> for SimulationTime

source§

type Output = SimulationTime

The resulting type after applying the * operator.
source§

fn mul(self, other: u32) -> Self::Output

Performs the * operation. Read more
source§

impl MulAssign<u32> for SimulationTime

source§

fn mul_assign(&mut self, rhs: u32)

Performs the *= operation. Read more
source§

impl Ord for SimulationTime

source§

fn cmp(&self, other: &SimulationTime) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for SimulationTime

source§

fn eq(&self, other: &SimulationTime) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for SimulationTime

source§

fn partial_cmp(&self, other: &SimulationTime) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Rem for SimulationTime

source§

type Output = SimulationTime

The resulting type after applying the % operator.
source§

fn rem(self, other: SimulationTime) -> Self::Output

Performs the % operation. Read more
source§

impl Sub<SimulationTime> for EmulatedTime

source§

type Output = EmulatedTime

The resulting type after applying the - operator.
source§

fn sub(self, other: SimulationTime) -> Self

Performs the - operation. Read more
source§

impl Sub for SimulationTime

source§

type Output = SimulationTime

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Self::Output

Performs the - operation. Read more
source§

impl SubAssign<SimulationTime> for EmulatedTime

source§

fn sub_assign(&mut self, rhs: SimulationTime)

Performs the -= operation. Read more
source§

impl SubAssign for SimulationTime

source§

fn sub_assign(&mut self, rhs: SimulationTime)

Performs the -= operation. Read more
source§

impl TryFrom<Duration> for SimulationTime

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(val: Duration) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<SimulationTime> for timespec

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: SimulationTime) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<SimulationTime> for timeval

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: SimulationTime) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<SimulationTime> for timespec

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: SimulationTime) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<SimulationTime> for timeval

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: SimulationTime) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<linux_timespec> for SimulationTime

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: timespec) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<linux_timeval> for SimulationTime

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: timeval) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<timespec> for SimulationTime

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: timespec) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<timeval> for SimulationTime

source§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(value: timeval) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl VirtualAddressSpaceIndependent for SimulationTime

source§

const IGNORE: () = _

Used by the derive macro to validate that fields are Vasi.
source§

impl Copy for SimulationTime

source§

impl Eq for SimulationTime

source§

impl StructuralPartialEq for SimulationTime

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> NoTypeInference for T

source§

type This = T

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V