pub struct CommandContext<'a> {
pub fs: &'a dyn VirtualFs,
pub cwd: &'a str,
pub env: &'a HashMap<String, String>,
pub variables: Option<&'a HashMap<String, Variable>>,
pub stdin: &'a str,
pub stdin_bytes: Option<&'a [u8]>,
pub limits: &'a ExecutionLimits,
pub network_policy: &'a NetworkPolicy,
pub exec: Option<ExecCallback<'a>>,
pub shell_opts: Option<&'a ShellOpts>,
}Expand description
Context passed to command execution.
Fields§
§fs: &'a dyn VirtualFs§cwd: &'a str§env: &'a HashMap<String, String>§variables: Option<&'a HashMap<String, Variable>>Full variable map with types — used for test -v array element checks.
stdin: &'a str§stdin_bytes: Option<&'a [u8]>Binary input from a previous pipeline stage (e.g. gzip output).
Commands that handle binary input check this first, falling back to stdin.
limits: &'a ExecutionLimits§network_policy: &'a NetworkPolicy§exec: Option<ExecCallback<'a>>§shell_opts: Option<&'a ShellOpts>Shell options (set -o), used by test -o optname.
Auto 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