pub struct Execution { /* private fields */ }Expand description
A running plan. Every method takes &self, and the handle can be shared
between threads.
Implementations§
Source§impl Execution
impl Execution
Sourcepub fn start(
plan: &Plan,
lib_dir: &Path,
this: &Path,
options: Options,
) -> Result<(Self, Receiver<ExecutionEvent>), EngineError>
pub fn start( plan: &Plan, lib_dir: &Path, this: &Path, options: Options, ) -> Result<(Self, Receiver<ExecutionEvent>), EngineError>
Check the plan’s requirements and start its program, with its history marker. Errors are what keeps it from starting.
Sourcepub fn write(&self, bytes: &[u8])
pub fn write(&self, bytes: &[u8])
Send keyboard input to the program, as a terminal would: \r for
Enter, \x03 for Ctrl-C (which the program sees, unlike stop).
Sourcepub fn resize(&self, rows: u16, cols: u16)
pub fn resize(&self, rows: u16, cols: u16)
Give the terminal a new size; the program is told when it changes.
Sourcepub fn stop(&self)
pub fn stop(&self)
Stop the run. The first request hangs up every process in the run’s process group, as a closing terminal does; a later one, while any of them is still running, kills them.
Sourcepub fn stop_requested(&self) -> bool
pub fn stop_requested(&self) -> bool
Whether a stop was requested.
Sourcepub fn survivors(&self) -> usize
pub fn survivors(&self) -> usize
How many processes of the run are still alive, such as ones that ignored the hangup.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Whether the run has ended and been checked: true from just before
its Completed or Interrupted event is sent.
Sourcepub fn transcript(&self) -> Vec<u8> ⓘ
pub fn transcript(&self) -> Vec<u8> ⓘ
Everything the program has written so far, as the Output events
carry it.
Sourcepub fn record(&self, log: Option<PathBuf>) -> Result<()>
pub fn record(&self, log: Option<PathBuf>) -> Result<()>
Write the run’s history record, with a saved log if there is one. Only the first call once the run has ended writes it; dropping the handle writes it without a log if no call did. Until then the history’s marker keeps the outcome, in case HelixForge stops first.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Execution
impl RefUnwindSafe for Execution
impl Send for Execution
impl Sync for Execution
impl Unpin for Execution
impl UnsafeUnpin for Execution
impl UnwindSafe for Execution
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.