Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin:
    Send
    + Sync
    + 'static {
    // Required methods
    fn metadata(&self) -> PluginMetadata;
    fn on_enable(&self, registrar: &mut PluginRegistrar<'_>);

    // Provided method
    fn on_disable(&self) { ... }
}
Expand description

A server plugin that registers event handlers and lifecycle hooks.

Required Methods§

Source

fn metadata(&self) -> PluginMetadata

Returns the plugin’s identity metadata.

Source

fn on_enable(&self, registrar: &mut PluginRegistrar<'_>)

Called when the plugin is enabled. Register event handlers and commands here.

Provided Methods§

Source

fn on_disable(&self)

Called when the plugin is disabled (server shutdown).

Implementors§