Skip to main content

PluginProvider

Trait PluginProvider 

Source
pub trait PluginProvider: Send + Sync {
    // Required method
    fn get(&self, name: &str) -> Option<Arc<dyn Plugin>>;

    // Provided method
    fn version(&self) -> u64 { ... }
}
Expand description

Plugin provider trait

Required Methods§

Source

fn get(&self, name: &str) -> Option<Arc<dyn Plugin>>

Get a plugin by name

§Arguments
  • name - The name of the plugin to get
§Returns
  • Option<Arc<dyn Plugin>> - The plugin if found, None otherwise

Provided Methods§

Source

fn version(&self) -> u64

A number that changes whenever get could start returning different plugins - after a plugin reload. Locations cache the plugins they resolved through get and rebuild the list when this moves, so a provider whose plugins can change must implement it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§