pub struct Executor<'env> {
pub env: &'env mut ShellEnv,
pub builtins: BuiltinRegistry,
pub jobs: JobTable,
}Expand description
The command executor.
Holds a mutable reference to the shell environment and a builtin registry. Create one per top-level evaluation.
Fields§
§env: &'env mut ShellEnv§builtins: BuiltinRegistry§jobs: JobTableImplementations§
Source§impl<'env> Executor<'env>
impl<'env> Executor<'env>
Sourcepub fn execute_program(&mut self, program: &Program) -> ExecResult
pub fn execute_program(&mut self, program: &Program) -> ExecResult
Execute an entire program (a list of complete commands).
Sourcepub fn execute_pipeline(&mut self, pipeline: &Pipeline) -> ExecResult
pub fn execute_pipeline(&mut self, pipeline: &Pipeline) -> ExecResult
Execute a pipeline of one or more commands connected by pipes.
Sourcepub fn execute_command(&mut self, cmd: &Command) -> ExecResult
pub fn execute_command(&mut self, cmd: &Command) -> ExecResult
Execute a single command node from the AST.
Sourcepub fn execute_simple(&mut self, cmd: &SimpleCommand) -> ExecResult
pub fn execute_simple(&mut self, cmd: &SimpleCommand) -> ExecResult
Execute a simple command (assignments + words + redirects).
Sourcepub fn expand_word(&mut self, word: &Word) -> String
pub fn expand_word(&mut self, word: &Word) -> String
Expand a Word AST node into a plain string, performing all expansions.
Auto Trait Implementations§
impl<'env> Freeze for Executor<'env>
impl<'env> !RefUnwindSafe for Executor<'env>
impl<'env> Send for Executor<'env>
impl<'env> Sync for Executor<'env>
impl<'env> Unpin for Executor<'env>
impl<'env> UnsafeUnpin for Executor<'env>
impl<'env> !UnwindSafe for Executor<'env>
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