pub trait Plugin:
Any
+ Send
+ Sync {
// Required method
fn name(&self) -> &'static str;
// Provided methods
fn on_plugin_load(&mut self, _config: Config) { ... }
fn on_plugin_unload(&self) { ... }
}Expand description
A plugin which allows you to add extra functionality to the REST client.
Required Methods§
Provided Methods§
Sourcefn on_plugin_load(&mut self, _config: Config)
fn on_plugin_load(&mut self, _config: Config)
A callback fired immediately after the plugin is loaded. Usually used for initialization.
Sourcefn on_plugin_unload(&self)
fn on_plugin_unload(&self)
A callback fired immediately before the plugin is unloaded. Use this if you need to do any cleanup.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".