Trait PluginLoader

Source
pub trait PluginLoader: Send + Sync {
    // Required methods
    fn load_plugin<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Plugin>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn validate_plugin<'life0, 'life1, 'async_trait>(
        &'life0 self,
        plugin: &'life1 dyn Plugin,
    ) -> Pin<Box<dyn Future<Output = Result<ValidationResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn unload_plugin<'life0, 'life1, 'async_trait>(
        &'life0 self,
        plugin_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Plugin loader trait for different loading mechanisms

Required Methods§

Source

fn load_plugin<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Plugin>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load a plugin from the given path

Source

fn validate_plugin<'life0, 'life1, 'async_trait>( &'life0 self, plugin: &'life1 dyn Plugin, ) -> Pin<Box<dyn Future<Output = Result<ValidationResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate a plugin before loading

Source

fn unload_plugin<'life0, 'life1, 'async_trait>( &'life0 self, plugin_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unload a plugin

Implementors§