pub struct CommandContext<'a> {
pub fs: &'a dyn VirtualFs,
pub cwd: &'a str,
pub env: &'a HashMap<String, String>,
pub stdin: &'a str,
pub stdout: &'a mut String,
pub stderr: &'a mut String,
pub exec_fn: Option<&'a dyn Fn(&str) -> Result<ExecResult, Error>>,
pub limits: &'a ExecutionLimits,
}Expand description
Provides filesystem, environment, and I/O access to commands.
Commands receive this as &mut so they can write to stdout/stderr.
The filesystem and environment are borrowed from the interpreter.
Fields§
§fs: &'a dyn VirtualFs§cwd: &'a str§env: &'a HashMap<String, String>§stdin: &'a str§stdout: &'a mut String§stderr: &'a mut String§exec_fn: Option<&'a dyn Fn(&str) -> Result<ExecResult, Error>>§limits: &'a ExecutionLimitsAuto Trait Implementations§
impl<'a> Freeze for CommandContext<'a>
impl<'a> !RefUnwindSafe for CommandContext<'a>
impl<'a> !Send for CommandContext<'a>
impl<'a> !Sync for CommandContext<'a>
impl<'a> Unpin for CommandContext<'a>
impl<'a> UnsafeUnpin for CommandContext<'a>
impl<'a> !UnwindSafe for CommandContext<'a>
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