br_addon/addon.rs
use std::any::type_name;
use crate::module::{Module};
/// 插件接口
pub trait Addon {
/// 插件名称
fn name(&self) -> String {
type_name::<Self>().rsplit("::").next().unwrap().to_lowercase()
}
/// 功能标题
fn title(&self) -> &'static str;
/// 模型分流
fn module(&mut self, name: &str) -> Result<Box<dyn Module>, String>;
}