[−][src]Trait command_builder::Command
Required methods
fn run_internal(
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output>
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output>
The command used to define all others. input: the string to be piped into the next command run. clear_env: if the global enviromental variables should be cleared. env: what enviromental variables to set, supercedes clear_env.
Provided methods
fn and<C: Command>(self, other: C) -> And<Self, C>
Equivalent to &&, as in "command 1" && "command 2".
fn or<C: Command>(self, other: C) -> Or<Self, C>
Equivalent to ||, as in "command 1" || "command 2".
fn then<C: Command>(self, other: C) -> Then<Self, C>
Equivalent to ;, as in "command 1"; "command 2".
fn pipe<C: Command>(self, other: C) -> Pipe<Self, C>
Equivalent to |, as in "pipe 1" | "into 2".
fn env(self, key: &str, value: &str) -> Env<Self>
Sets the env in the environment the command is run in.
fn clear_envs(self) -> ClearEnv<Self>
Clears the environment for non-explicitly set variables.
fn without_env(self, key: &str) -> ExceptEnv<Self>
Removes a variable from the enviroment in which the command is run.
fn without_envs<I: IntoIterator<Item = String>>(
self,
envs: I
) -> ExceptEnvs<Self, I>
self,
envs: I
) -> ExceptEnvs<Self, I>
Takes an iterable of Strings for keys to remove.
fn with_dir<P: AsRef<Path>>(self, dir: P) -> Dir<Self>
fn run(&self) -> Result<Output>
Runs the command.
fn with_input(self, input: &str) -> Input<Self>
Pipes input
into the following command.
Implementors
impl Command for Single
[src]
fn run_internal(
&self,
input: Option<&str>,
do_clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output, Error>
[src]
&self,
input: Option<&str>,
do_clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output, Error>
impl<C: Command> Command for Dir<C>
[src]
fn run_internal(
&self,
input: Option<&str>,
clear_env: bool,
envs: HashMap<String, String>,
del_envs: HashSet<String>,
_: Option<PathBuf>
) -> Result<Output, Error>
[src]
&self,
input: Option<&str>,
clear_env: bool,
envs: HashMap<String, String>,
del_envs: HashSet<String>,
_: Option<PathBuf>
) -> Result<Output, Error>
impl<F: Command> Command for ClearEnv<F>
[src]
fn run_internal(
&self,
input: Option<&str>,
_: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output, Error>
[src]
&self,
input: Option<&str>,
_: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output, Error>
impl<F: Command> Command for Env<F>
[src]
fn run_internal(
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output, Error>
[src]
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output, Error>
impl<F: Command> Command for ExceptEnv<F>
[src]
fn run_internal(
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output, Error>
[src]
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output, Error>
impl<F: Command> Command for Input<F>
[src]
fn run_internal(
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output, Error>
[src]
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output, Error>
impl<F: Command, S: Command> Command for And<F, S>
[src]
fn run_internal(
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output, Error>
[src]
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output, Error>
impl<F: Command, S: Command> Command for Or<F, S>
[src]
fn run_internal(
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output>
[src]
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output>
impl<F: Command, S: Command> Command for Pipe<F, S>
[src]
fn run_internal(
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output, Error>
[src]
&self,
input: Option<&str>,
clear_env: bool,
env: HashMap<String, String>,
del_env: HashSet<String>,
path: Option<PathBuf>
) -> Result<Output, Error>