Skip to main content

Addon

Trait Addon 

Source
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§

Source

fn name(&self) -> &str

Source

fn check_prerequisites(&self, project_root: &Path) -> Result<()>

Source

fn is_already_installed(&self, project_root: &Path) -> bool

Source

fn install(&self, project_root: &Path) -> Result<()>

Provided Methods§

Source

fn uninstall(&self, project_root: &Path) -> Result<()>

Uninstall the addon. Default implementation returns an error.

Source

fn dependencies(&self) -> Vec<&str>

Return the names of addons this addon depends on.

Implementors§