[][src]Struct simrs::ClockRef

pub struct ClockRef { /* fields omitted */ }

This struct exposes only immutable access to the simulation clock. The clock itself is owned by the scheduler, while others can obtain ClockRef to read the current simulation time.

Example

let scheduler = Scheduler::default();
let clock_ref = scheduler.clock();
assert_eq!(clock_ref.time(), scheduler.time());

Implementations

impl ClockRef[src]

#[must_use]pub fn time(&self) -> Duration[src]

Return the current simulation time.

Trait Implementations

impl From<Rc<Cell<Duration>>> for ClockRef[src]

Auto Trait Implementations

impl !RefUnwindSafe for ClockRef

impl !Send for ClockRef

impl !Sync for ClockRef

impl Unpin for ClockRef

impl !UnwindSafe for ClockRef

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.