Trait dygpi::plugin::Plugin [−][src]
pub trait Plugin: Any + Debug + Sync + Send { fn plugin_id(&self) -> &String; fn on_load(&self) -> Result<()>; fn on_unload(&self) -> Result<()>; }
Expand description
This trait must be implemented by any plugin type, it not only provides a plugin id, but also provides lifecycle methods which implementors can use to manage resources owned by the plugin.
Required methods
Return the plug-in identifier for this instance. In general a unique format that also provides some debug/trace value is to use the package/module path as shown below.
const PLUGIN_ID: &str = concat!(env!("CARGO_PKG_NAME"), "::", module_path!(), "::MyPlugin");
Called by the plugin manager after the registration process is complete.