Struct dygpi::manager::PluginManager[][src]

pub struct PluginManager<T> where
    T: Plugin
{ /* fields omitted */ }
Expand description

The plugin manager loads and unloads plugins from a library which is dynamically opened and closed as necessary.

Implementations

Construct a new plugin manager and have it use the values of the string slice as a search path when loading libraries.

Load all plugins from the libraries that are specified in the named environment variable.

The environment variable’s value is assumed to be a list of paths separated by the colon, ':' character.

Load all plugins from the libraries specified in the string slice, each value is a file path.

Load all plugins from a single library with the provided file name/path.

Override the default registration function name PLUGIN_REGISTRATION_FN_NAME.

This function must conform to the type PluginRegistrationFn, and must be marked as #[no_mangle] pub extern "C" in the same manner as the standard registration function.

Example

use dygpi::plugin::{Plugin, PluginRegistrar};

#[no_mangle]
pub extern "C" fn register_sources(registrar: &mut PluginRegistrar<SoundSourcePlugin>) {
    registrar.register(SoundSourcePlugin::new(PLUGIN_NAME));
}

#[no_mangle]
pub extern "C" fn register_effects(registrar: &mut PluginRegistrar<SoundEffectPlugin>) {
    registrar.register(SoundEffectPlugin::new(OTHER_PLUGIN_NAME));
}

Returns true if the plugin manager has no plugins registered, else false.

Return the number of plugins registered in this plugin manager.

Returns true if this plugin manager has a registered plugin with the provided plugin identifier, else false.

Returns the plugin with the provided plugin identifier, if one exists, else None.

Return all the plugins registered in this plugin manager as a vector.

Unload all plugins, and associated libraries, that are currently registered in this plugin manager.

Unload the plugin identified by the provided plugin identifier, if one exists. Note that this method will also close the plugin library if no other plugins are using it.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.