Macro rhai::combine_with_exported_module [−][src]
combine_with_exported_module!() { /* proc-macro */ }
Expand description
Macro to combine a plugin module into an existing module.
Functions and variables in the plugin module overrides any existing similarly-named functions and variables in the target module.
This call is intended to be used within the def_package!
macro to define a custom
package based on a plugin module.
All sub-modules, if any, in the plugin module are flattened and their functions/variables registered at the top level because packages require so.
The text string name in the second parameter can be anything and is reserved for future use; it is recommended to be an ID string that uniquely identifies the plugin module.
Usage
ⓘ
use rhai::plugin::*;
#[export_module]
mod my_plugin_module {
...
}
let mut module = Module::new();
combine_with_exported_module!(&mut module, "my_plugin_module_ID", my_plugin_module);