pub struct Executor<R: CommandRunner> { /* private fields */ }Expand description
Orchestration engine that walks a Program AST and applies shell-like
execution semantics.
Generic over CommandRunner so the actual command dispatch is pluggable.
The composition root wires in a concrete runner (e.g., a process spawner,
a hook dispatcher, or a test double).
§Semantics
&&/||— connect pipelines; the gate is the previous pipeline’s success.|— pipe stdout of one command into the next.|&— pipe stdout + stderr of one command into the next.?suffix — marks a command as optional; optional commands in sequence accumulate their outputs into aContext, which is serialized as JSON and passed to the first non-optional command that follows.>/>>— redirect the final command’s stdout to a file.
Implementations§
Source§impl<R: CommandRunner> Executor<R>
impl<R: CommandRunner> Executor<R>
pub fn new(runner: R) -> Self
Sourcepub fn into_runner(self) -> R
pub fn into_runner(self) -> R
Consume the executor and return the underlying runner.
Useful in tests to inspect what the runner recorded after execution.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for Executor<R>where
R: Freeze,
impl<R> RefUnwindSafe for Executor<R>where
R: RefUnwindSafe,
impl<R> Send for Executor<R>where
R: Send,
impl<R> Sync for Executor<R>where
R: Sync,
impl<R> Unpin for Executor<R>where
R: Unpin,
impl<R> UnsafeUnpin for Executor<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for Executor<R>where
R: UnwindSafe,
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
Mutably borrows from an owned value. Read more