pub struct ProgramRunner<S: Scalar> { /* private fields */ }Expand description
Builds a program the way an editor needs it built: incrementally, and only as far as asked.
It keeps the part after every step it has run. Running again after an edit reuses the part after the longest unchanged prefix of steps, so changing the last step replays one step, not the whole history. And a run can stop early — while a step in the middle is being edited, only the steps up to it need to run, however long the rest of the program is. Parts past the stop are kept, not discarded, so moving the stop back again costs nothing.
A run stops at the first step that fails: the steps after it would only fail too, for want of what it should have built.
Implementations§
Source§impl<S: Scalar> ProgramRunner<S>
impl<S: Scalar> ProgramRunner<S>
pub fn new() -> Self
Sourcepub fn run(&mut self, program: &Program, stop: Option<usize>)
pub fn run(&mut self, program: &Program, stop: Option<usize>)
Runs the first stop steps of program — all of them if None —
reusing whatever the previous runs built that still applies. See
ProgramRunner::part and ProgramRunner::results for the
outcome.
Sourcepub fn results(&self) -> &[StepResult]
pub fn results(&self) -> &[StepResult]
One result per step the last run covered.
Sourcepub fn handles(&self) -> GeopResult<Vec<StepHandle>>
pub fn handles(&self) -> GeopResult<Vec<StepHandle>>
Every handle of every step the last run built — all of them, of every group: which to offer is an editor’s choice. Each is placed with the part as its step saw it.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for ProgramRunner<S>
impl<S> RefUnwindSafe for ProgramRunner<S>where
S: RefUnwindSafe,
impl<S> Send for ProgramRunner<S>
impl<S> Sync for ProgramRunner<S>
impl<S> Unpin for ProgramRunner<S>where
S: Unpin,
impl<S> UnsafeUnpin for ProgramRunner<S>
impl<S> UnwindSafe for ProgramRunner<S>where
S: UnwindSafe + RefUnwindSafe,
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