pub trait PluginLua: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn on_load(&mut self) -> Result<(), Box<dyn Error>>;
fn on_unload(&mut self) -> Result<(), Box<dyn Error>>;
fn get_lua_functions(
&self,
lua: &Lua,
name: &str,
) -> HashMap<String, Function>;
}
Expand description
Trait that all Lua plugins must implement.
Provides the required methods for plugin lifecycle management and Lua function registration.
Required Methods§
Sourcefn on_load(&mut self) -> Result<(), Box<dyn Error>>
fn on_load(&mut self) -> Result<(), Box<dyn Error>>
Called when the plugin is loaded.
This method is used for initializing resources or performing setup tasks.