JustEnoughMod_core/
lib.rs

1/// The `PluginRegistrar` is defined by the application and passed to `plugin_entry`. It's used
2/// for a plugin module to register itself with the application.
3pub trait PluginRegistrar {
4    fn register_plugin(&mut self, plugin: Box<dyn Plugin>);
5}
6
7/// `Plugin` is implemented by a plugin library for one or more types. As you need additional
8/// callbacks, they can be defined here. These are first class Rust trait objects, so you have the
9/// full flexibility of that system. The main thing you'll lose access to is generics, but that's
10/// expected with a plugin system
11pub trait Plugin {
12    /// This is a callback routine implemented by the plugin.
13    fn init(&self);
14}