pub struct SimTime(pub u32);Expand description
Simulation time in milliseconds.
Tuple Fields§
§0: u32Implementations§
Source§impl SimTime
impl SimTime
pub const ZERO: SimTime
pub const MAX: SimTime
const MS_PER_SEC: u32 = 1000
const MS_PER_SEC_F32: f32 = 1000.0
pub const fn from_millis(ms: u32) -> Self
pub const fn from_secs(secs: u32) -> Self
pub fn from_secs_f32(secs: f32) -> Self
pub fn from_secs_f64(secs: f64) -> Self
pub const fn as_millis(&self) -> u32
pub fn as_secs_f32(&self) -> f32
pub fn as_secs_f64(&self) -> f64
pub const fn saturating_sub(self, other: SimTime) -> SimTime
pub const fn saturating_add(self, other: SimTime) -> SimTime
Trait Implementations§
Source§impl AddAssign for SimTime
impl AddAssign for SimTime
Source§fn add_assign(&mut self, rhs: SimTime)
fn add_assign(&mut self, rhs: SimTime)
Performs the
+= operation. Read moreSource§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 FromWasmAbi for SimTimewhere
Self: DeserializeOwned,
impl FromWasmAbi for SimTimewhere
Self: DeserializeOwned,
Source§impl IntoWasmAbi for &SimTime
impl IntoWasmAbi for &SimTime
Source§impl IntoWasmAbi for SimTime
impl IntoWasmAbi for SimTime
Source§impl OptionFromWasmAbi for SimTimewhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for SimTimewhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for SimTime
impl OptionIntoWasmAbi for SimTime
Source§impl Ord for SimTime
impl Ord for SimTime
Source§impl PartialOrd for SimTime
impl PartialOrd for SimTime
Source§impl RefFromWasmAbi for SimTimewhere
Self: DeserializeOwned,
impl RefFromWasmAbi for SimTimewhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
The Wasm ABI type references to
Self are recovered from.Source§impl SubAssign for SimTime
impl SubAssign for SimTime
Source§fn sub_assign(&mut self, rhs: SimTime)
fn sub_assign(&mut self, rhs: SimTime)
Performs the
-= operation. Read moreSource§impl Tsify for SimTime
impl Tsify for SimTime
const DECL: &'static str = "/**\n * Simulation time in milliseconds.\n */\nexport type SimTime = number;"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Source§impl VectorFromWasmAbi for SimTimewhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for SimTimewhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for SimTime
impl VectorIntoWasmAbi for SimTime
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribeVector for SimTime
impl WasmDescribeVector 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> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.