pub enum SimCommand {
Play,
Pause,
StepOnce,
SetTargetTps(f64),
SetUncapped(bool),
SetTicksPerSnapshot(u32),
SetParam {
index: usize,
value: ParamValue,
},
Act(usize),
SetLayout {
on: bool,
budget_ms: f32,
while_paused: bool,
},
SetSchedule(Schedule),
RunTo(u64),
Shutdown,
}Expand description
Commands sent from the UI thread to the simulation thread.
Variants§
Play
Start stepping. It cancels a pending Self::RunTo.
Pause
Stop stepping, and publish the state the run stopped at.
StepOnce
Run one step and publish.
SetTargetTps(f64)
Set the target rate in ticks per second.
SetUncapped(bool)
Step as fast as possible when true, ignoring the target rate.
SetTicksPerSnapshot(u32)
Set the number of ticks one capped batch steps, at least 1.
SetParam
Set one parameter of the running model.
Fields
value: ParamValueNew value.
Act(usize)
Run the model’s declared action at this index, once.
SetLayout
Turn the layout on or off, with a time budget per publish in milliseconds.
The layout relaxes on every publish that follows a tick. While paused, it relaxes only if while_paused is set.
Fields
budget_ms: f32Time in milliseconds that one publish may spend relaxing the layout, capped at
MAX_VIEW_BUDGET_MS.
SetSchedule(Schedule)
Replace the actions fired at their ticks, and fire those due at the current tick at once unless it has fired.
Each later action fires once, after the step that reaches its tick. A tick has fired once a step has reached it or an earlier schedule has fired it. No tick fires twice.
RunTo(u64)
Step as fast as possible to this tick, then pause and publish.
Play, Pause and StepOnce cancel it. A tick at or behind the current one pauses at once.
Shutdown
Stop the loop. A runner sends it when dropped.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SimCommand
impl RefUnwindSafe for SimCommand
impl Send for SimCommand
impl Sync for SimCommand
impl Unpin for SimCommand
impl UnsafeUnpin for SimCommand
impl UnwindSafe for SimCommand
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more