pub struct Executor { /* private fields */ }
Expand description
Executor is used for simple execution of an entire simulation.
See the crate level documentation for examples.
Implementations
sourceimpl Executor
impl Executor
sourcepub fn unbound() -> Self
pub fn unbound() -> Self
Simulation will end only once there is no available events in the queue.
sourcepub fn timed(time: Duration) -> Self
pub fn timed(time: Duration) -> Self
Simulation will be run no longer than the given time. It may terminate early if no events are available.
sourcepub fn steps(steps: usize) -> Self
pub fn steps(steps: usize) -> Self
Simulation will execute exactly this many steps, unless we run out of events.
sourcepub fn side_effect<F>(self, func: F) -> ExecutorWithSideEffect<F> where
F: Fn(&Simulation),
pub fn side_effect<F>(self, func: F) -> ExecutorWithSideEffect<F> where
F: Fn(&Simulation),
Registers a side effect that is called after each simulation step.
Trait Implementations
sourceimpl Execute for Executor
impl Execute for Executor
sourcefn execute(self, sim: &mut Simulation)
fn execute(self, sim: &mut Simulation)
Executes the simulation until some stopping condition is reached. The condition is implementation-specific. Read more
impl Copy for Executor
impl Eq for Executor
impl StructuralEq for Executor
impl StructuralPartialEq for Executor
Auto Trait Implementations
impl RefUnwindSafe for Executor
impl Send for Executor
impl Sync for Executor
impl Unpin for Executor
impl UnwindSafe for Executor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more