Installer

Trait Installer 

Source
pub trait Installer: Sync + Send {
    // Required methods
    fn bin_name(&self) -> &'static str;
    fn install(&self) -> Result<()>;

    // Provided methods
    fn check(&self) -> Option<Result<String>> { ... }
    fn run(&self) -> Result<()> { ... }
    fn check_args(&self) -> Option<&[&str]> { ... }
}
Expand description

Trait for installing development tools and language servers.

Required Methods§

Source

fn bin_name(&self) -> &'static str

Returns the binary name of the tool to install.

Source

fn install(&self) -> Result<()>

Installs the tool to the configured location.

Provided Methods§

Source

fn check(&self) -> Option<Result<String>>

Checks if the tool is installed correctly.

Source

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

Execute install + optional check; emit status & per-phase timings.

§Errors
§Assumptions
§Rationale
  • Uniform UX: always attempt install then (if supported) lightweight smoke test.
  • Prints a single line including phase durations: install_time=<dur> check_time=<dur|None> total_time=<dur> to quickly spot slow tools.
  • Keeps tool-specific logic encapsulated; orchestration only formats and times phases.
§Performance
  • Overhead limited to a few Instant captures and formatted prints.
Source

fn check_args(&self) -> Option<&[&str]>

Returns arguments for version check.

Implementors§