pub struct PluginSet { /* private fields */ }Expand description
The loaded modules of one app, in declaration order.
Libraries are dlopen’d once and held for the process lifetime: a plugin hands out function bodies, threads, and a host handle, none of which survive the code they live in being unmapped.
Implementations§
Source§impl PluginSet
impl PluginSet
Sourcepub fn load(
modules: &[ResolvedModule],
env: &InitEnv,
hooks: Arc<dyn HostHooks>,
) -> (Self, Vec<LoadFailure>)
pub fn load( modules: &[ResolvedModule], env: &InitEnv, hooks: Arc<dyn HostHooks>, ) -> (Self, Vec<LoadFailure>)
Load every module, in order. Each one that fails is collected with its name, the file that was probed, and the reason; the rest load.
Sourcepub fn install(&self, app: &mut App)
pub fn install(&self, app: &mut App)
Bind every loaded module’s functions and language sources onto the app, in declaration order.
The bodies call back into the plugin, so this runs before the script hosts load and the app keeps the set alive for as long as it runs.
Sourcepub fn shutdown(&self)
pub fn shutdown(&self)
Tell every module the app is going down, in declaration order. Best effort: a module that exports no shutdown is skipped, and the libraries stay mapped either way.