Skip to main content

PluginApi

Trait PluginApi 

Source
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§

Source

fn api_version(&self) -> &str

Get the plugin API version this plugin was compiled against

Source

fn initialize_api(&mut self, host_info: &HostInfo) -> PluginResult<()>

Initialize the plugin with host information

Source

fn get_plugin_info(&self) -> PluginInfo

Get plugin capabilities as a structured format

Source

fn handle_api_call(&self, call: &ApiCall) -> PluginResult<ApiResponse>

Handle API calls from the host

Source

fn notify(&self, event: &PluginEvent) -> PluginResult<()>

Notify plugin of host events

Source

fn supports_feature(&self, feature: &str) -> bool

Check if plugin supports a specific feature

Implementors§