pub struct ExecCommandInput {
pub command: String,
pub args: Vec<String>,
pub cwd: Option<VirtualPath>,
pub env: FxHashMap<String, String>,
pub paths: Vec<VirtualPath>,
pub shell: Option<String>,
pub stream: bool,
/* private fields */
}Expand description
Input passed to the exec_command host function.
Fields§
§command: StringThe command or script to execute. Accepts an executable
name available on PATH or a virtual path.
args: Vec<String>Arguments to pass to the command.
cwd: Option<VirtualPath>Override the current working directory.
env: FxHashMap<String, String>Environment variables to pass to the command. Variables can customize behavior by appending one of the following characters to the name:
? - Will only set variable if it doesn’t exist
in the current environment.
! - Will remove the variable from being inherited
by the child process.
paths: Vec<VirtualPath>List of real or virtual paths to prepend to the PATH
environment variable when executing the command.
shell: Option<String>Set the shell to execute the command with, for example “bash”.
stream: boolStream the output instead of capturing it.
Implementations§
Source§impl ExecCommandInput
impl ExecCommandInput
Sourcepub fn cwd(self, value: VirtualPath) -> Self
pub fn cwd(self, value: VirtualPath) -> Self
Sets the cwd field of this struct.
Sourcepub fn paths(self, value: Vec<VirtualPath>) -> Self
pub fn paths(self, value: Vec<VirtualPath>) -> Self
Sets the paths field of this struct.
Source§impl ExecCommandInput
impl ExecCommandInput
Sourcepub fn new<C, I, V>(command: C, args: I) -> ExecCommandInput
pub fn new<C, I, V>(command: C, args: I) -> ExecCommandInput
Create a new command that inherits and streams the output.
Sourcepub fn pipe<C, I, V>(command: C, args: I) -> ExecCommandInput
pub fn pipe<C, I, V>(command: C, args: I) -> ExecCommandInput
Create a new command that pipes and captures the output.
Sourcepub fn inherit<C, I, V>(command: C, args: I) -> ExecCommandInput
pub fn inherit<C, I, V>(command: C, args: I) -> ExecCommandInput
Create a new command that inherits and streams the output.
Trait Implementations§
Source§impl Clone for ExecCommandInput
impl Clone for ExecCommandInput
Source§fn clone(&self) -> ExecCommandInput
fn clone(&self) -> ExecCommandInput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more