Module dygpi::manager [−][src]
Expand description
The components required by a plugin host to load/unload plugins.
The primary component of the plugin host’s interaction is the PluginManager
;
this type manages the lifecycle of plugins, as well as opening and closing the necessary dynamic
libraries.
Example
As the example below shows, the plugin manager is relatively simple in it’s interface. However,
as any more complex host may require loading multiple libraries, and different types of plugins,
the PluginManagerConfiguration
type is a
higher-level abstraction.
use dygpi::manager::PluginManager; use dygpi::plugin::Plugin; use std::sync::Arc; let mut plugin_manager: PluginManager<SoundEffectPlugin> = PluginManager::default(); plugin_manager .load_plugins_from("libsound_one.dylib".as_ref()) .unwrap(); let plugin: Arc<SoundEffectPlugin> = plugin_manager .get("sound_one::sound_one::DelayEffect") .unwrap(); println!("{}", plugin.plugin_id()); plugin.play();
Structs
The plugin manager loads and unloads plugins from a library which is dynamically opened and closed as necessary.
Constants
File name extension commonly used for a dynamic library.
Prefix for dynamic libraries, if any.
Functions
Given a file name, or path with a file name, return a new path that formats the file name
according to common platform conventions. PluginManager
does not use this function directly,
it is up to the client to determine whether to use this before passing a file path to the
manager.