devrc_plugins/plugin.rs
1use std::any::Any;
2
3use crate::config::Config;
4
5/// A plugin which allows you to add extra functionality to the REST client.
6pub trait Plugin: Any + Send + Sync {
7 /// Get a name describing the `Plugin`.
8 fn name(&self) -> &'static str;
9 /// A callback fired immediately after the plugin is loaded. Usually used
10 /// for initialization.
11 fn on_plugin_load(&mut self, _config: Config) {}
12 /// A callback fired immediately before the plugin is unloaded. Use this if
13 /// you need to do any cleanup.
14 fn on_plugin_unload(&self) {}
15}