pub trait CommandExt {
// Required methods
fn from_script(_: &str) -> Self;
fn with_arg<S: AsRef<OsStr>>(self, _: S) -> Self;
fn with_args<I, S>(self, _: I) -> Self
where I: IntoIterator<Item = S>,
S: AsRef<OsStr>;
fn display(&self) -> String;
fn detach(&mut self) -> &mut Self;
fn spawn_detached(&mut self) -> Option<Child>;
fn spawn_piped(&mut self) -> Result<ChildStdout, StringError>;
fn success(&mut self) -> bool;
fn _exec(&mut self) -> !;
fn _spawn(&mut self) -> Option<Child>;
}Required Methods§
Sourcefn from_script(_: &str) -> Self
fn from_script(_: &str) -> Self
Use SHELL to create a command from a shell script
On unix, the empty string is given to $0 so that subsequent args are fed to the script directly.
On windows (todo)
fn with_arg<S: AsRef<OsStr>>(self, _: S) -> Self
fn with_args<I, S>(self, _: I) -> Self
Sourcefn detach(&mut self) -> &mut Self
fn detach(&mut self) -> &mut Self
Detach the command. Does nothing on unsupported platforms (not windows or unix).
Sourcefn spawn_detached(&mut self) -> Option<Child>
fn spawn_detached(&mut self) -> Option<Child>
One-off spawn executable. Logs the command in debug builds. Prints error.
Sourcefn spawn_piped(&mut self) -> Result<ChildStdout, StringError>
fn spawn_piped(&mut self) -> Result<ChildStdout, StringError>
Spawn command with piped stdout. Debug logs the command.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.