Plugin

Trait Plugin 

Source
pub trait Plugin: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn version(&self) -> &str;
    fn description(&self) -> &str;
    fn author(&self) -> &str;
    fn generators(&self) -> Vec<&dyn CustomGenerator>;

    // Provided methods
    fn initialize(&self) -> Result<()> { ... }
    fn cleanup(&mut self) -> Result<()> { ... }
    fn config(&self) -> HashMap<String, Value> { ... }
    fn set_config(&mut self, config: HashMap<String, Value>) -> Result<()> { ... }
}
Expand description

插件特征

Required Methods§

Source

fn name(&self) -> &str

插件名称

Source

fn version(&self) -> &str

插件版本

Source

fn description(&self) -> &str

插件描述

Source

fn author(&self) -> &str

插件作者

Source

fn generators(&self) -> Vec<&dyn CustomGenerator>

获取插件提供的生成器

Provided Methods§

Source

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

初始化插件

Source

fn cleanup(&mut self) -> Result<()>

清理插件

Source

fn config(&self) -> HashMap<String, Value>

插件配置

Source

fn set_config(&mut self, config: HashMap<String, Value>) -> Result<()>

设置插件配置

Implementors§