Trait rustwide::cmd::Runnable

source ·
pub trait Runnable {
    // Required method
    fn name(&self) -> Binary;

    // Provided method
    fn prepare_command<'w, 'pl>(
        &self,
        cmd: Command<'w, 'pl>
    ) -> Command<'w, 'pl> { ... }
}
Expand description

Trait representing a command that can be run by Command.

Required Methods§

source

fn name(&self) -> Binary

The name of the binary to execute.

Provided Methods§

source

fn prepare_command<'w, 'pl>(&self, cmd: Command<'w, 'pl>) -> Command<'w, 'pl>

Prepare the command for execution. This method is called as soon as a Command instance is created, and allows tweaking the command to better suit your binary, for example by adding default arguments or environment variables.

The default implementation simply returns the provided command without changing anything in it.

Implementations on Foreign Types§

source§

impl Runnable for String

source§

fn name(&self) -> Binary

source§

impl<'a, B: Runnable> Runnable for &'a B

source§

fn name(&self) -> Binary

source§

fn prepare_command<'w, 'pl>(&self, cmd: Command<'w, 'pl>) -> Command<'w, 'pl>

source§

impl<'a> Runnable for &'a str

source§

fn name(&self) -> Binary

Implementors§