pub trait ModuleFactory: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn create(&self, context: &Context) -> Box<dyn Module>;
fn config<'a>(&self, context: &'a Context) -> Option<&'a dyn ModuleConfig>;
}Expand description
Factory trait for constructing modules and exposing their config binding
Required Methods§
Sourcefn create(&self, context: &Context) -> Box<dyn Module>
fn create(&self, context: &Context) -> Box<dyn Module>
Create a fresh module instance for the given context
Sourcefn config<'a>(&self, context: &'a Context) -> Option<&'a dyn ModuleConfig>
fn config<'a>(&self, context: &'a Context) -> Option<&'a dyn ModuleConfig>
Obtain the module-specific config view from Context