pub trait Plugin: Send + Sync {
// Required methods
fn info(&self) -> &PluginInfo;
fn initialize(&mut self, api: &dyn PluginAPIInterface) -> Result<(), String>;
fn invoke_command(
&self,
command: &str,
params: Value,
api: &dyn PluginAPIInterface,
) -> Result<Value, String>;
fn shutdown(&self) -> Result<(), String>;
// Provided methods
fn get_schema_extensions(&self) -> Vec<SchemaExtension> { ... }
fn get_frontend_bundle(&self) -> Option<Vec<u8>> { ... }
}Expand description
Plugin trait that all plugins must implement
Required Methods§
Sourcefn info(&self) -> &PluginInfo
fn info(&self) -> &PluginInfo
Get plugin metadata
Sourcefn initialize(&mut self, api: &dyn PluginAPIInterface) -> Result<(), String>
fn initialize(&mut self, api: &dyn PluginAPIInterface) -> Result<(), String>
Initialize the plugin
Sourcefn invoke_command(
&self,
command: &str,
params: Value,
api: &dyn PluginAPIInterface,
) -> Result<Value, String>
fn invoke_command( &self, command: &str, params: Value, api: &dyn PluginAPIInterface, ) -> Result<Value, String>
Invoke a command on the plugin The api parameter provides database access and other core functionality
Provided Methods§
Sourcefn get_schema_extensions(&self) -> Vec<SchemaExtension>
fn get_schema_extensions(&self) -> Vec<SchemaExtension>
Get schema extensions that this plugin requires This allows plugins to declare their own database tables and schema changes
Sourcefn get_frontend_bundle(&self) -> Option<Vec<u8>>
fn get_frontend_bundle(&self) -> Option<Vec<u8>>
Get frontend bundle bytes (if plugin provides UI)