pub struct ExecCommandInput {
pub command: String,
pub args: Vec<String>,
pub env: HashMap<String, String, FxBuildHasher>,
pub shell: Option<String>,
pub stream: bool,
pub cwd: Option<VirtualPath>,
/* private fields */
}
Expand description
Input passed to the exec_command
host function.
Fields§
§command: String
The command or script to execute. Accepts an executable
on PATH
or a virtual path.
args: Vec<String>
Arguments to pass to the command.
env: HashMap<String, String, FxBuildHasher>
Environment variables to pass to the command.
shell: Option<String>
Set the shell to execute the command with, for example “bash”. If not defined, will be detected from the parent process.
stream: bool
Stream the output instead of capturing it.
cwd: Option<VirtualPath>
Override the current working directory.
Implementations§
Source§impl ExecCommandInput
impl ExecCommandInput
Sourcepub fn command(self, value: impl Into<String>) -> ExecCommandInput
pub fn command(self, value: impl Into<String>) -> ExecCommandInput
Sets the command
field of this struct.
Sourcepub fn env(
self,
value: HashMap<String, String, FxBuildHasher>,
) -> ExecCommandInput
pub fn env( self, value: HashMap<String, String, FxBuildHasher>, ) -> ExecCommandInput
Sets the env
field of this struct.
Sourcepub fn shell(self, value: impl Into<String>) -> ExecCommandInput
pub fn shell(self, value: impl Into<String>) -> ExecCommandInput
Sets the shell
field of this struct.
Sourcepub fn stream(self) -> ExecCommandInput
pub fn stream(self) -> ExecCommandInput
Sets the stream
field of this struct.
Sourcepub fn cwd(self, value: VirtualPath) -> ExecCommandInput
pub fn cwd(self, value: VirtualPath) -> ExecCommandInput
Sets the cwd
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