pub trait InstallCommand<F: Display> {
    // Required methods
    fn base_command(&self) -> Exec;
    fn args(&self) -> &Vec<String>;
    fn action_description(&self) -> &str;
    fn action_name(&self) -> &str;
    fn items(&self) -> &Vec<F>;

    // Provided methods
    fn formatted_item_list(&self) -> Vec<String> { ... }
    fn execute(&self) -> Result<(), DotfilesError> { ... }
}
Expand description

Trait that represents a command that installs an item using an action (brew install, brew install cask, apt install…)

Required Methods§

source

fn base_command(&self) -> Exec

The base command to run

source

fn args(&self) -> &Vec<String>

The arguments to pass to the command

source

fn action_description(&self) -> &str

The description of the action to run, i.e. “Installing cask”

source

fn action_name(&self) -> &str

The name of the action to run, i.e. “cask”

source

fn items(&self) -> &Vec<F>

The item actually being installed, for example a homebrew formula.

Provided Methods§

source

fn formatted_item_list(&self) -> Vec<String>

a list of items to display

source

fn execute(&self) -> Result<(), DotfilesError>

Runs the command to execut

Implementors§