Struct checked_command::CheckedCommand
[−]
[src]
pub struct CheckedCommand { /* fields omitted */ }
A wrapper around std::process::Command
which hides the original status
/output
methods
and replaces them with the versions from checked_command::CommandExt
Methods
impl CheckedCommand
[src]
fn as_std_command(&mut self) -> &mut Command
return a mutable reference to the wrapped std::process::Command
this can be useful if the cammand has to be passed to a function
or to access a extension trait for std::process::Command
fn into_std_command(self) -> Command
converts this Command into a std::process::Command
(basically unwrapping it).
Note that this function was intentionally provided instead
of Into<Command>
as the main reason for this wrapper is
to prevent forgetting to check the exit status. As such it
will forward all calls except spawn
,status
and output
which normally tend to be the last function ever called on
a command instances. Therefore converting a CheckedCommand
to a Command
is quite likely a bug. (Through there are some
cases where it makes sense).
fn new<S: AsRef<OsStr>>(program: S) -> CheckedCommand
creates a new CheckedCommand
see std::process:Command::new
for more details
fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut CheckedCommand
calls std::process::Command::arg
fn args<I, S>(&mut self, args: I) -> &mut CheckedCommand where
I: IntoIterator<Item = S>,
S: AsRef<OsStr>,
I: IntoIterator<Item = S>,
S: AsRef<OsStr>,
calls std::process::Command::args
fn env<K, V>(&mut self, key: K, val: V) -> &mut CheckedCommand where
K: AsRef<OsStr>,
V: AsRef<OsStr>,
K: AsRef<OsStr>,
V: AsRef<OsStr>,
calls std::process::Command::env
fn env_remove<K: AsRef<OsStr>>(&mut self, key: K) -> &mut CheckedCommand
calls std::process::Command::env_remove
fn env_clear(&mut self) -> &mut CheckedCommand
calls std::process::Command::env_clear
fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut CheckedCommand
calls std::process::Command::current_dir
fn stdin(&mut self, cfg: Stdio) -> &mut CheckedCommand
calls std::process::Command::stdin
fn stdout(&mut self, cfg: Stdio) -> &mut CheckedCommand
calls std::process::Command::stdout
fn stderr(&mut self, cfg: Stdio) -> &mut CheckedCommand
calls std::process::Command::stderr
fn spawn(&mut self) -> Result<CheckedChild, IoError>
calls std::process::Command::spawn
and converts the
Child
into a CheckedChild
fn output(&mut self) -> Result<Output, Error>
calls CommandExt::checked_output
on the wrapped Command
fn status(&mut self) -> Result<(), Error>
calls CommandExt::checked_status
on the wrapped Command
Trait Implementations
impl Debug for CheckedCommand
[src]
impl From<Command> for CheckedCommand
[src]
fn from(command: Command) -> CheckedCommand
Performs the conversion.