Plugin

Trait Plugin 

Source
pub trait Plugin:
    Send
    + Sync
    + 'static {
    // Provided methods
    fn name(&self) -> &'static str { ... }
    fn on_resumed(&mut self, _context: &PluginContext) -> PluginResult { ... }
    fn on_suspended(&mut self, _context: &PluginContext) -> PluginResult { ... }
    fn on_shutdown(&mut self, _context: &PluginContext) -> PluginResult { ... }
}
Expand description

Lifecycle hooks for platform plugins.

Provided Methods§

Source

fn name(&self) -> &'static str

Returns the plugin name for logging and diagnostics.

Source

fn on_resumed(&mut self, _context: &PluginContext) -> PluginResult

Called when the renderer creates or resumes its platform resources.

Source

fn on_suspended(&mut self, _context: &PluginContext) -> PluginResult

Called when the renderer suspends and releases platform resources.

Source

fn on_shutdown(&mut self, _context: &PluginContext) -> PluginResult

Called when the renderer is shutting down.

Implementors§