From bff720018c683698b13dbc3d84a2853cd24cfd54 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 19 Oct 2015 17:54:32 +0200 Subject: [PATCH] Module trait cleanups --- src/module.rs | 12 ------------ src/module/mod.rs | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 12 deletions(-) delete mode 100644 src/module.rs create mode 100644 src/module/mod.rs diff --git a/src/module.rs b/src/module.rs deleted file mode 100644 index 0897190f..00000000 --- a/src/module.rs +++ /dev/null @@ -1,12 +0,0 @@ -use runtime::Runtime; -use std::error::Error; - -pub trait Module { - - fn load(&self, &rt : Runtime) -> Self; - fn name(&self) -> String; - - fn execute(&self, &rt : Runtime) -> Option; - fn shutdown(&self, &rt : Runtime) -> Option; - -} diff --git a/src/module/mod.rs b/src/module/mod.rs new file mode 100644 index 00000000..5298fae9 --- /dev/null +++ b/src/module/mod.rs @@ -0,0 +1,23 @@ +pub use runtime::Runtime; +pub use std::error::Error; +pub use std::fs::Path; + +pub use module::todo::TodoModule; + +pub trait Module { + + fn load(&self, &rt : Runtime) -> Option; + fn callnames() -> [String]; + fn name(&self) -> String; + + fn execute(&self, &rt : Runtime) -> Option; + fn shutdown(&self, &rt : Runtime) -> Option; + +} + +pub trait TouchingModule : Module { + + fn load_with_path(&self, rt : &Runtime, path : &Path) -> Self; + +} +