pub trait Module {
// Required methods
fn id(&self) -> &str;
fn config(&self) -> &ModuleConfig;
fn head_tags(&self) -> &Nodes;
fn view(&self) -> Nodes;
fn run(
&mut self,
runtime_info: Rc<RuntimeInformation>,
) -> Result<(), LewpError>;
// Provided methods
fn into_module_ptr(self) -> ModulePtr
where Self: Sized + 'static { ... }
fn render(&self) -> Nodes { ... }
}
Expand description
Defines a web page module.
Required Methods§
Sourcefn id(&self) -> &str
fn id(&self) -> &str
Returns the unique module id.
Allowed characters for id are [a-z]
, [0-9]
and -
.
There is currently no check wether other characters are used. So please
make sure that you do not use any other characters while creating modules.
Sourcefn config(&self) -> &ModuleConfig
fn config(&self) -> &ModuleConfig
The configuration of the module.
Borrows the head tags that are required to run this module in a web page.
Provided Methods§
Sourcefn into_module_ptr(self) -> ModulePtrwhere
Self: Sized + 'static,
fn into_module_ptr(self) -> ModulePtrwhere
Self: Sized + 'static,
Wraps self
into a Rc<RefCell<>>