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§
Provided Methods§
Sourcefn run(&self) -> Result<()>
fn run(&self) -> Result<()>
Execute install + optional check; emit status & per-phase timings.
§Errors
- Any error from
Installer::install. - Any process / UTF-8 error from the check phase.
§Assumptions
Installer::installleaves the binary runnable viaInstaller::bin_name.Installer::check_args(whenSome) is fast and exits 0 on success.- ANSI color output acceptable (CI tolerates ANSI sequences).
§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
Instantcaptures and formatted prints.
Sourcefn check_args(&self) -> Option<&[&str]>
fn check_args(&self) -> Option<&[&str]>
Returns arguments for version check.