pub struct PluginLoader { /* private fields */ }Expand description
Loader for plug-in cdylibs.
Owns every Library for the lifetime of the live node, since v1 does not
support dlclose. Caller walks the returned LoadedPlugin manifests to
register entries into the relevant runtime registries.
Implementations§
Source§impl PluginLoader
impl PluginLoader
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new, empty loader that hands every plug-in the default
nautilus-plugin host vtable. The default vtable carries
NotImplemented stubs for stateful host callbacks; use
PluginLoader::with_host to install a live-node vtable.
Sourcepub fn with_host(host: *const HostVTable) -> Self
pub fn with_host(host: *const HostVTable) -> Self
Creates a new, empty loader that will hand every loaded plug-in the
supplied host vtable instead of the default.
host must remain live for the lifetime of every plug-in loaded
through this loader (typically the process lifetime).
Sourcepub fn load_all<P>(
&mut self,
paths: impl IntoIterator<Item = P>,
) -> Result<(), LoadError>
pub fn load_all<P>( &mut self, paths: impl IntoIterator<Item = P>, ) -> Result<(), LoadError>
Loads every plug-in path in order. Stops on the first error.
Sourcepub fn load(
&mut self,
path: impl AsRef<OsStr>,
) -> Result<&LoadedPlugin, LoadError>
pub fn load( &mut self, path: impl AsRef<OsStr>, ) -> Result<&LoadedPlugin, LoadError>
Loads a single plug-in cdylib.
Sourcepub fn loaded(&self) -> &[LoadedPlugin]
pub fn loaded(&self) -> &[LoadedPlugin]
Returns every loaded plug-in in load order.
Trait Implementations§
Source§impl Debug for PluginLoader
impl Debug for PluginLoader
Source§impl Default for PluginLoader
impl Default for PluginLoader
Source§fn default() -> PluginLoader
fn default() -> PluginLoader
impl Send for PluginLoader
SAFETY: *const HostVTable is a process-lifetime static pointer; the host
commits to keeping the vtable live and the inner fn pointers are Sync by
construction.
impl Sync for PluginLoader
SAFETY: see above.