[][src]Struct simrs::Scheduler

pub struct Scheduler { /* fields omitted */ }

Scheduler is used to keep the current time and information about the upcoming events.

See the crate-level documentation for more information.

Implementations

impl Scheduler[src]

pub fn schedule<E: Debug + 'static>(
    &mut self,
    time: Duration,
    component: ComponentId<E>,
    event: E
)
[src]

Schedules event to be executed for component at self.time() + time.

pub fn schedule_immediately<E: Debug + 'static>(
    &mut self,
    component: ComponentId<E>,
    event: E
)
[src]

Schedules event to be executed for component at self.time().

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

Returns the current simulation time.

#[must_use]pub fn clock(&self) -> ClockRef[src]

Returns a structure with immutable access to the simulation time.

pub fn pop(&mut self) -> Option<EventEntry>[src]

Removes and returns the next scheduled event or None if none are left.

Trait Implementations

impl Default for Scheduler[src]

Auto Trait Implementations

impl !RefUnwindSafe for Scheduler

impl !Send for Scheduler

impl !Sync for Scheduler

impl Unpin for Scheduler

impl !UnwindSafe for Scheduler

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.