TerminalApplications

Trait TerminalApplications 

Source
pub trait TerminalApplications<T: Execute<U>, U>:
    Sized
    + Default
    + Content<T> {
    // Required method
    fn parse_yaml(&mut self, yaml: &Mapping);

    // Provided methods
    fn update_from_config(&mut self, config_file: &str) { ... }
    fn execute(&self, status: &Status) -> Result<U> { ... }
}
Expand description

Common methods of terminal applications. Wether they require interaction and are opened in a new terminal or not and are previewed. All those applications are configurable from a config file and share their configuration. Only the yaml parsing should be implemented specifically since more information is required for some application.

Required Methods§

Source

fn parse_yaml(&mut self, yaml: &Mapping)

Provided Methods§

Source

fn update_from_config(&mut self, config_file: &str)

Source

fn execute(&self, status: &Status) -> Result<U>

Run the selected command and capture its output. Some environement variables are first set to ensure the colored output. Long running commands may freeze the display.

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.

Implementors§