pub trait CommandExt {
// Required methods
fn script(script: &str) -> Self;
fn in_repo(&mut self) -> &mut Self;
fn check_output(&mut self) -> Result<String>;
fn check_run(&mut self) -> Result<()>;
fn run(&mut self) -> Result<ExitStatus>;
fn wait(&mut self, message: impl Into<Cow<'static, str>>) -> Result<()>;
fn pre_exec(&self);
fn features(&mut self, features: &[String]) -> &mut Self;
}
Expand description
Overlay some extra helper functions onto std::process::Command
Required Methods§
fn script(script: &str) -> Self
fn in_repo(&mut self) -> &mut Self
fn check_output(&mut self) -> Result<String>
fn check_run(&mut self) -> Result<()>
fn run(&mut self) -> Result<ExitStatus>
fn wait(&mut self, message: impl Into<Cow<'static, str>>) -> Result<()>
fn pre_exec(&self)
fn features(&mut self, features: &[String]) -> &mut Self
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.
Implementations on Foreign Types§
Source§impl CommandExt for Command
impl CommandExt for Command
Source§fn script(script: &str) -> Self
fn script(script: &str) -> Self
Create a new command to execute the named script in the repository scripts
directory.
Source§fn in_repo(&mut self) -> &mut Self
fn in_repo(&mut self) -> &mut Self
Set the command’s working directory to the repository directory.
Source§fn check_output(&mut self) -> Result<String>
fn check_output(&mut self) -> Result<String>
Run the command and capture its output.
Source§fn run(&mut self) -> Result<ExitStatus>
fn run(&mut self) -> Result<ExitStatus>
Run the command and catch its exit code.
Source§fn wait(&mut self, message: impl Into<Cow<'static, str>>) -> Result<()>
fn wait(&mut self, message: impl Into<Cow<'static, str>>) -> Result<()>
Run the command, capture its output, and display a progress bar while it’s executing. Intended to be used for long-running processes with little interaction.