reactive_graph_plugin_api/
plugin.rs

1use async_trait::async_trait;
2
3use crate::PluginActivationError;
4use crate::PluginDeactivationError;
5use crate::injectable;
6
7pub const PLUGIN_NAME_PREFIX: &str = "reactive-graph-plugin-";
8
9#[cfg_attr(feature = "springtime", injectable)]
10#[async_trait]
11pub trait Plugin: Send + Sync {
12    /// Called on initialization of the plugin.
13    async fn activate(&self) -> Result<(), PluginActivationError> {
14        Ok(())
15    }
16
17    /// Called on deactivation of the plugin.
18    async fn deactivate(&self) -> Result<(), PluginDeactivationError> {
19        Ok(())
20    }
21}