1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
extern crate plugin_test_api as plugin_api; //extern crate nom; //extern crate french; mod english; // should we do that? pub use english::*; //pub use french::*; use plugin_api::PluginInformation; use std::collections::hash_map::HashMap; pub struct Plugins { list: HashMap<String, Box<PluginInformation> >, } ///FIXME: should return a static list of plugins ///FIXME: the plugin tool must know about the traits ///PluginInfo and the PluginMetadata from each plugin /// do we import them by predefined name or declare them somewhere? pub fn plugins() -> Plugins { let mut h: HashMap<String, Box<PluginInformation> > = HashMap::new(); h.insert("english".to_string(), Box::new(english::PLUGIN_METADATA)); Plugins { list: h } }