[−][src]Struct checked_command::CheckedCommand
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]
pub fn as_std_command(&mut self) -> &mut Command[src]
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
pub fn into_std_command(self) -> Command[src]
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).
pub fn new<S: AsRef<OsStr>>(program: S) -> CheckedCommand[src]
creates a new CheckedCommand
see std::process:Command::new for more details
pub fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut CheckedCommand[src]
calls std::process::Command::arg
pub fn args<I, S>(&mut self, args: I) -> &mut CheckedCommand where
I: IntoIterator<Item = S>,
S: AsRef<OsStr>, [src]
I: IntoIterator<Item = S>,
S: AsRef<OsStr>,
calls std::process::Command::args
pub fn env<K, V>(&mut self, key: K, val: V) -> &mut CheckedCommand where
K: AsRef<OsStr>,
V: AsRef<OsStr>, [src]
K: AsRef<OsStr>,
V: AsRef<OsStr>,
calls std::process::Command::env
pub fn env_remove<K: AsRef<OsStr>>(&mut self, key: K) -> &mut CheckedCommand[src]
calls std::process::Command::env_remove
pub fn env_clear(&mut self) -> &mut CheckedCommand[src]
calls std::process::Command::env_clear
pub fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut CheckedCommand[src]
calls std::process::Command::current_dir
pub fn stdin(&mut self, cfg: Stdio) -> &mut CheckedCommand[src]
calls std::process::Command::stdin
pub fn stdout(&mut self, cfg: Stdio) -> &mut CheckedCommand[src]
calls std::process::Command::stdout
pub fn stderr(&mut self, cfg: Stdio) -> &mut CheckedCommand[src]
calls std::process::Command::stderr
pub fn spawn(&mut self) -> Result<CheckedChild, IoError>[src]
calls std::process::Command::spawn and converts the
Child into a CheckedChild
pub fn output(&mut self) -> Result<Output, Error>[src]
calls CommandExt::checked_output on the wrapped Command
pub fn status(&mut self) -> Result<(), Error>[src]
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[src]
Auto Trait Implementations
impl !RefUnwindSafe for CheckedCommand
impl Send for CheckedCommand
impl !Sync for CheckedCommand
impl Unpin for CheckedCommand
impl !UnwindSafe for CheckedCommand
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,