PluginApi

Trait PluginApi 

Source
pub trait PluginApi {
    // Required methods
    fn initialize(&mut self, config: Value) -> Result<(), String>;
    fn start(&mut self) -> Result<(), String>;
    fn stop(&mut self) -> Result<(), String>;
    fn handle_command(
        &mut self,
        command: &str,
        args: Value,
    ) -> Result<Value, String>;
    fn get_status(&self) -> Value;
    fn handle_event(&mut self, event: &str, data: Value) -> Result<(), String>;
}
Expand description

Plugin API interface.

Required Methods§

Source

fn initialize(&mut self, config: Value) -> Result<(), String>

Initialize the plugin.

Source

fn start(&mut self) -> Result<(), String>

Start the plugin.

Source

fn stop(&mut self) -> Result<(), String>

Stop the plugin.

Source

fn handle_command( &mut self, command: &str, args: Value, ) -> Result<Value, String>

Handle a command.

Source

fn get_status(&self) -> Value

Get plugin status.

Source

fn handle_event(&mut self, event: &str, data: Value) -> Result<(), String>

Handle events.

Implementors§