pub struct Command {
pub program: String,
pub args: Vec<String>,
pub env: Vec<(String, String)>,
pub env_remove: Vec<String>,
pub clear_env: bool,
pub cwd: Option<String>,
pub stdin: Stdio,
pub stdout: Stdio,
pub stderr: Stdio,
}Expand description
A program with its arguments, environment, directory and streams. It
inherits the plugin’s environment (env) and runs in
the user’s home unless told otherwise.
Fields§
§program: String§args: Vec<String>§env: Vec<(String, String)>Variables set on top of the plugin’s environment (env).
env_remove: Vec<String>Variables removed from the plugin’s environment first.
clear_env: boolStart from an empty environment: only Command::env.
cwd: Option<String>The working directory; the user’s home when None.
stdin: Stdio§stdout: Stdio§stderr: StdioImplementations§
Source§impl Command
impl Command
pub fn arg(self, arg: &str) -> Self
pub fn args(self, args: &[&str]) -> Self
pub fn env(self, key: &str, value: &str) -> Self
Sourcepub fn env_remove(self, key: &str) -> Self
pub fn env_remove(self, key: &str) -> Self
Removes key from the inherited environment (GIT_DIR, say).
pub fn clear_env(self) -> Self
pub fn cwd(self, cwd: &str) -> Self
pub fn stdin(self, stdin: Stdio) -> Self
pub fn stdout(self, stdout: Stdio) -> Self
pub fn stderr(self, stderr: Stdio) -> Self
pub fn spawn(&self) -> Result<Child>
Trait Implementations§
impl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
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