Trait SubModule

Source
pub trait SubModule: Module {
    // Required methods
    fn submodules(&self) -> &Modules;
    fn submodules_mut(&mut self) -> &mut Modules;

    // Provided methods
    fn append_module(&mut self, module: ModulePtr) -> Result<(), LewpError> { ... }
    fn render_submodules(&self, parent_module_view: &mut Nodes) { ... }
    fn render_submodule(
        &self,
        idx: usize,
        parent_module_view: &mut Nodes,
    ) -> Result<(), LewpError> { ... }
    fn render_submodule_id(
        &self,
        id: &str,
        parent_module_view: &mut Nodes,
    ) -> Result<(), LewpError> { ... }
    fn render_submodule_id_all(
        &self,
        id: &str,
        parent_module_view: &mut Nodes,
    ) -> Result<(), LewpError> { ... }
    fn run_submodules(
        &mut self,
        runtime_information: Rc<RuntimeInformation>,
    ) -> Result<(), LewpError> { ... }
    fn run_submodule(&mut self, idx: usize) -> Result<(), LewpError> { ... }
    fn run_submodule_id(&mut self, id: &str) -> Result<(), LewpError> { ... }
    fn run_submodule_id_all(&mut self, id: &str) -> Result<(), LewpError> { ... }
    fn component_information(&self) -> Rc<ComponentInformation> { ... }
}
Expand description

Enables management of submodules.

Required Methods§

Source

fn submodules(&self) -> &Modules

Returns a reference to the submodules.

Source

fn submodules_mut(&mut self) -> &mut Modules

Returns a mutable reference to the submodules.

Provided Methods§

Source

fn append_module(&mut self, module: ModulePtr) -> Result<(), LewpError>

Appends the given module as a submodule.

Source

fn render_submodules(&self, parent_module_view: &mut Nodes)

Renders all submodules to the parent view.

Source

fn render_submodule( &self, idx: usize, parent_module_view: &mut Nodes, ) -> Result<(), LewpError>

Renders the given submodule to the parent view.

Parameters:

idx: The index of the module in Self::submodules.

Source

fn render_submodule_id( &self, id: &str, parent_module_view: &mut Nodes, ) -> Result<(), LewpError>

Renders the first submodule with the given id.

Parameters:

id: The unique identifier of the module.

Source

fn render_submodule_id_all( &self, id: &str, parent_module_view: &mut Nodes, ) -> Result<(), LewpError>

Renders all submodules with the given id.

Parameters:

id: The unique identifier of the modules to be rendered.

Source

fn run_submodules( &mut self, runtime_information: Rc<RuntimeInformation>, ) -> Result<(), LewpError>

Runs all submodules in order as they are returned in Self::submodules.

Source

fn run_submodule(&mut self, idx: usize) -> Result<(), LewpError>

Runs the given submodule.

Parameters:

idx: The index of the module in Self::submodules.

Source

fn run_submodule_id(&mut self, id: &str) -> Result<(), LewpError>

Runs the first submodule with the given id.

Parameters:

id: The unique identifier of the module.

Source

fn run_submodule_id_all(&mut self, id: &str) -> Result<(), LewpError>

Runs all submodules with the given id.

Parameters:

id: The unique identifier of the modules to be run.

Source

fn component_information(&self) -> Rc<ComponentInformation>

Returns the meta information for this submodule.

Implementors§