pub trait PluginApi: Send + Sync {
// Required methods
fn api_version(&self) -> &str;
fn initialize_api(&mut self, host_info: &HostInfo) -> PluginResult<()>;
fn get_plugin_info(&self) -> PluginInfo;
fn handle_api_call(&self, call: &ApiCall) -> PluginResult<ApiResponse>;
fn notify(&self, event: &PluginEvent) -> PluginResult<()>;
fn supports_feature(&self, feature: &str) -> bool;
}Expand description
Plugin API interface that all plugins must implement
Required Methods§
Sourcefn api_version(&self) -> &str
fn api_version(&self) -> &str
Get the plugin API version this plugin was compiled against
Sourcefn initialize_api(&mut self, host_info: &HostInfo) -> PluginResult<()>
fn initialize_api(&mut self, host_info: &HostInfo) -> PluginResult<()>
Initialize the plugin with host information
Sourcefn get_plugin_info(&self) -> PluginInfo
fn get_plugin_info(&self) -> PluginInfo
Get plugin capabilities as a structured format
Sourcefn handle_api_call(&self, call: &ApiCall) -> PluginResult<ApiResponse>
fn handle_api_call(&self, call: &ApiCall) -> PluginResult<ApiResponse>
Handle API calls from the host
Sourcefn notify(&self, event: &PluginEvent) -> PluginResult<()>
fn notify(&self, event: &PluginEvent) -> PluginResult<()>
Notify plugin of host events
Sourcefn supports_feature(&self, feature: &str) -> bool
fn supports_feature(&self, feature: &str) -> bool
Check if plugin supports a specific feature