pub trait Addon {
// Required methods
fn name(&self) -> &str;
fn check_prerequisites(&self, project_root: &Path) -> Result<()>;
fn is_already_installed(&self, project_root: &Path) -> bool;
fn install(&self, project_root: &Path) -> Result<()>;
// Provided methods
fn uninstall(&self, project_root: &Path) -> Result<()> { ... }
fn dependencies(&self) -> Vec<&str> { ... }
}Expand description
Trait that all addons implement to provide a consistent installation interface.
Required Methods§
fn name(&self) -> &str
fn check_prerequisites(&self, project_root: &Path) -> Result<()>
fn is_already_installed(&self, project_root: &Path) -> bool
fn install(&self, project_root: &Path) -> Result<()>
Provided Methods§
Sourcefn uninstall(&self, project_root: &Path) -> Result<()>
fn uninstall(&self, project_root: &Path) -> Result<()>
Uninstall the addon. Default implementation returns an error.
Sourcefn dependencies(&self) -> Vec<&str>
fn dependencies(&self) -> Vec<&str>
Return the names of addons this addon depends on.