pub struct FileExtLoader {
pub plugins: JoinSet<Result<(Vec<String>, RuntimeFileExt), Report>>,
}Expand description
Use this struct to load and store the plugins.
Fields§
§plugins: JoinSet<Result<(Vec<String>, RuntimeFileExt), Report>>Implementations§
Source§impl FileExtLoader
impl FileExtLoader
Sourcepub async fn new() -> Result<FileExtLoader, Report>
pub async fn new() -> Result<FileExtLoader, Report>
Create a new FileExtLoader with an empty set of plugins.
Sourcepub fn load_statically_linked_plugin<T>(&mut self)where
T: FileExtPlugin + 'static,
pub fn load_statically_linked_plugin<T>(&mut self)where
T: FileExtPlugin + 'static,
Load a statically linked plugin by calling the new method of the plugin. This function
is not async, so it will not await for the plugin to be loaded. It will spawn a new
task to load the plugin and return immediately.
Before using any loaded plugin, the FileExtLoader::finish method must be called to
await for all the plugins to be loaded and return them.
Sourcepub fn load_dynamically_linked_plugin(&mut self, path: PathBuf)
pub fn load_dynamically_linked_plugin(&mut self, path: PathBuf)
Load a dynamically linked plugin by calling the new method of the plugin. This function
is not async, so it will not await for the plugin to be loaded. It will spawn a new
task to load the plugin and return immediately.
Before using any loaded plugin, the FileExtLoader::finish method must be called to
await for all the plugins to be loaded and return them.