vdev::app

Trait CommandExt

Source
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§

Source

fn script(script: &str) -> Self

Source

fn in_repo(&mut self) -> &mut Self

Source

fn check_output(&mut self) -> Result<String>

Source

fn check_run(&mut self) -> Result<()>

Source

fn run(&mut self) -> Result<ExitStatus>

Source

fn wait(&mut self, message: impl Into<Cow<'static, str>>) -> Result<()>

Source

fn pre_exec(&self)

Source

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

Source§

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

Set the command’s working directory to the repository directory.

Source§

fn check_output(&mut self) -> Result<String>

Run the command and capture its output.

Source§

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<()>

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.

Source§

fn pre_exec(&self)

Print out a pre-execution debug message.

Source§

fn check_run(&mut self) -> Result<()>

Source§

fn features(&mut self, features: &[String]) -> &mut Self

Implementors§