Plugin

Trait Plugin 

Source
pub trait Plugin {
    // Required method
    fn name(&self) -> &str;

    // Provided methods
    fn on_load(&mut self, _context: &PluginContext<'_>) { ... }
    fn on_unload(&mut self) { ... }
    fn pre_command(
        &self,
        _command: &str,
        _context: &PluginContext<'_>,
    ) -> Result<()> { ... }
    fn post_command(
        &self,
        _command: &str,
        _context: &PluginContext<'_>,
    ) -> Result<()> { ... }
}

Required Methods§

Source

fn name(&self) -> &str

Provided Methods§

Source

fn on_load(&mut self, _context: &PluginContext<'_>)

Source

fn on_unload(&mut self)

Source

fn pre_command( &self, _command: &str, _context: &PluginContext<'_>, ) -> Result<()>

Source

fn post_command( &self, _command: &str, _context: &PluginContext<'_>, ) -> Result<()>

Implementors§