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§
Sourcefn handle_command(
&mut self,
command: &str,
args: Value,
) -> Result<Value, String>
fn handle_command( &mut self, command: &str, args: Value, ) -> Result<Value, String>
Handle a command.
Sourcefn get_status(&self) -> Value
fn get_status(&self) -> Value
Get plugin status.