diff --git a/src/module/mod.rs b/src/module/mod.rs index 2c3d96d1..d45d494b 100644 --- a/src/module/mod.rs +++ b/src/module/mod.rs @@ -4,6 +4,7 @@ use std::fmt::Formatter; use std::fmt::Result as FMTResult; use std::fmt::Display; use std::result::Result; +use std::collections::HashMap; use storage::backend::StorageBackend; use self::command::ExecutableCommand; @@ -43,6 +44,7 @@ impl Display for ModuleError { } pub type ModuleResult = Result<(), ModuleError>; +pub type CommandMap<'a> = HashMap<&'a str, fn(&Runtime)>; pub trait Module { @@ -51,7 +53,7 @@ pub trait Module { fn name(&self) -> &'static str; fn shutdown(&self, rt : &Runtime) -> ModuleResult; - fn get_commands(&self, rt: &Runtime) -> Vec; + fn get_commands(&self, rt: &Runtime) -> CommandMap; }