pub trait PluginContainerManager:
Send
+ Sync
+ Lifecycle {
Show 55 methods
// Required methods
fn create_and_register_plugin_container(
&self,
stem: String,
path: PathBuf,
) -> Option<Uuid>;
fn remove_plugin_container(&self, id: &Uuid);
fn has(&self, stem: &str) -> bool;
fn get_id(&self, stem: &str) -> Option<Uuid>;
fn get_stem(&self, id: &Uuid) -> Option<String>;
fn name(&self, id: &Uuid) -> Option<String>;
fn name_canonicalized(&self, id: &Uuid) -> Option<String>;
fn name_version(&self, id: &Uuid) -> Option<String>;
fn description(&self, id: &Uuid) -> Option<String>;
fn version(&self, id: &Uuid) -> Option<String>;
fn rustc_version(&self, id: &Uuid) -> Option<String>;
fn plugin_api_version(&self, id: &Uuid) -> Option<String>;
fn count(&self) -> usize;
fn count_by_state(&self, state: &PluginState) -> usize;
fn count_by_states(&self) -> String;
fn count_by_state_str(&self, state: &PluginState) -> String;
fn get_plugin_path(&self, id: &Uuid) -> Option<String>;
fn get_plugin_state(&self, id: &Uuid) -> Option<PluginState>;
fn get_plugins(&self) -> Vec<Uuid>;
fn get_plugins_with_state(&self, state: PluginState) -> Vec<Uuid>;
fn get_plugins_with_states(
&self,
state1: PluginState,
state2: PluginState,
) -> Vec<Uuid>;
fn get_plugins_not_having_state(&self, state: PluginState) -> Vec<Uuid>;
fn get_plugin_by_dependency(
&self,
plugin_dependency: &PluginDependency,
) -> Option<Uuid>;
fn deploy_dll(&self, id: &Uuid) -> PluginTransitionResult;
fn load_dll(&self, id: &Uuid) -> PluginTransitionResult;
fn load_plugin_declaration(&self, id: &Uuid) -> PluginTransitionResult;
fn check_plugin_compatibility(&self, id: &Uuid) -> PluginTransitionResult;
fn load_plugin_dependencies(&self, id: &Uuid) -> PluginTransitionResult;
fn get_dependency_state(&self, dependency: &PluginDependency) -> PluginState;
fn has_dependencies(&self, id: &Uuid) -> bool;
fn get_dependencies(&self, id: &Uuid) -> DashSet<PluginDependency>;
fn has_unsatisfied_dependencies(&self, id: &Uuid) -> bool;
fn get_unsatisfied_dependencies(
&self,
id: &Uuid,
) -> DashSet<PluginDependency>;
fn get_dependents(&self, id: &Uuid) -> Vec<Uuid>;
fn set_state(
&self,
id: &Uuid,
new_state: PluginState,
) -> PluginTransitionResult;
fn resolve_dependencies_state(
&self,
id: &Uuid,
refreshing: bool,
) -> PluginTransitionResult;
fn construct_proxy(
&self,
id: &Uuid,
plugin_context: Arc<dyn PluginContext + Send + Sync>,
) -> PluginTransitionResult;
fn register(&self, id: &Uuid) -> PluginTransitionResult;
fn activate<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = PluginTransitionResult> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn are_all_stopped(&self) -> bool;
fn deactivate<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = PluginTransitionResult> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn unregister(&self, id: &Uuid) -> PluginTransitionResult;
fn remove_proxy(&self, id: &Uuid) -> PluginTransitionResult;
fn unload_dll(&self, id: &Uuid) -> PluginTransitionResult;
fn uninstall_dll(&self, id: &Uuid) -> PluginTransitionResult;
fn start(&self, id: &Uuid) -> Result<(), PluginStartError>;
fn start_by_stem(&self, stem: &str) -> Result<(), PluginStartError>;
fn start_dependent_with_satisfied_dependencies(&self, id: &Uuid) -> bool;
fn stop(&self, id: &Uuid) -> Result<(), PluginStopError>;
fn stop_by_stem(&self, stem: &str) -> Result<(), PluginStopError>;
fn stop_all(&self);
fn stop_active_with_unsatisfied_dependencies(&self) -> bool;
fn uninstall(&self, id: &Uuid) -> Result<(), PluginUninstallError>;
fn redeploy(&self, id: &Uuid) -> Result<(), PluginDeployError>;
fn disable(&self, id: &Uuid) -> Result<(), PluginDisableError>;
}
Required Methods§
Sourcefn create_and_register_plugin_container(
&self,
stem: String,
path: PathBuf,
) -> Option<Uuid>
fn create_and_register_plugin_container( &self, stem: String, path: PathBuf, ) -> Option<Uuid>
Creates a new plugin container for a plugin with the given file stem. The dynamically linked library is located at the given path which have to be in the plugin installation folder.
Sourcefn remove_plugin_container(&self, id: &Uuid)
fn remove_plugin_container(&self, id: &Uuid)
Returns the plugin with the given id from the list of plugin containers.
Sourcefn get_id(&self, stem: &str) -> Option<Uuid>
fn get_id(&self, stem: &str) -> Option<Uuid>
Returns the id of the plugin with the given file stem.
Sourcefn get_stem(&self, id: &Uuid) -> Option<String>
fn get_stem(&self, id: &Uuid) -> Option<String>
Returns the file stem of the plugin with the given id.
Sourcefn name_canonicalized(&self, id: &Uuid) -> Option<String>
fn name_canonicalized(&self, id: &Uuid) -> Option<String>
Returns the canonicalized name of the plugin with the given id.
Sourcefn name_version(&self, id: &Uuid) -> Option<String>
fn name_version(&self, id: &Uuid) -> Option<String>
Returns the canonicalized name and version of the plugin with the given id.
Sourcefn description(&self, id: &Uuid) -> Option<String>
fn description(&self, id: &Uuid) -> Option<String>
Returns the description of the plugin with the given id.
Sourcefn version(&self, id: &Uuid) -> Option<String>
fn version(&self, id: &Uuid) -> Option<String>
Returns the version of the plugin with the given id.
Sourcefn rustc_version(&self, id: &Uuid) -> Option<String>
fn rustc_version(&self, id: &Uuid) -> Option<String>
Returns the version of the rust compiler the plugin with the given id was compiled with.
Sourcefn plugin_api_version(&self, id: &Uuid) -> Option<String>
fn plugin_api_version(&self, id: &Uuid) -> Option<String>
Returns the version of the plugin API the plugin with the given id was compiled with.
Sourcefn count_by_state(&self, state: &PluginState) -> usize
fn count_by_state(&self, state: &PluginState) -> usize
Returns the count of plugins with the given state.
Sourcefn count_by_states(&self) -> String
fn count_by_states(&self) -> String
Returns a string withs stats abouts the states of the plugins
fn count_by_state_str(&self, state: &PluginState) -> String
Sourcefn get_plugin_path(&self, id: &Uuid) -> Option<String>
fn get_plugin_path(&self, id: &Uuid) -> Option<String>
Returns the path of the plugin with the given id.
Sourcefn get_plugin_state(&self, id: &Uuid) -> Option<PluginState>
fn get_plugin_state(&self, id: &Uuid) -> Option<PluginState>
Returns the state of the plugin with the given id.
Sourcefn get_plugins(&self) -> Vec<Uuid>
fn get_plugins(&self) -> Vec<Uuid>
Returns a list of ids of all plugins.
Sourcefn get_plugins_with_state(&self, state: PluginState) -> Vec<Uuid>
fn get_plugins_with_state(&self, state: PluginState) -> Vec<Uuid>
Returns a list of ids of plugins with the given state.
Sourcefn get_plugins_with_states(
&self,
state1: PluginState,
state2: PluginState,
) -> Vec<Uuid>
fn get_plugins_with_states( &self, state1: PluginState, state2: PluginState, ) -> Vec<Uuid>
Returns a list of ids of plugins which have one of the both states.
Sourcefn get_plugins_not_having_state(&self, state: PluginState) -> Vec<Uuid>
fn get_plugins_not_having_state(&self, state: PluginState) -> Vec<Uuid>
Returns a list of ids of plugins which doesn’t have the given state.
Sourcefn get_plugin_by_dependency(
&self,
plugin_dependency: &PluginDependency,
) -> Option<Uuid>
fn get_plugin_by_dependency( &self, plugin_dependency: &PluginDependency, ) -> Option<Uuid>
Returns the id of the plugin by a dependency coordinate.
Sourcefn deploy_dll(&self, id: &Uuid) -> PluginTransitionResult
fn deploy_dll(&self, id: &Uuid) -> PluginTransitionResult
Deploys the dynamic linked library file from the plugin hot deploy folder into the plugin installation folder.
The target filename will contain a timestamp in order to avoid that a cached previous version of the DLL will be loaded.
Sourcefn load_dll(&self, id: &Uuid) -> PluginTransitionResult
fn load_dll(&self, id: &Uuid) -> PluginTransitionResult
Loads the dynamic linked library into memory.
Sourcefn load_plugin_declaration(&self, id: &Uuid) -> PluginTransitionResult
fn load_plugin_declaration(&self, id: &Uuid) -> PluginTransitionResult
Loads the plugin declaration of the plugin with the given id.
The plugin declaration contains the version of the rust compiler and the plugin API in order to check for ABI compatibility.
The plugin have to contain a symbol named ‘plugin_declaration’.
Sourcefn check_plugin_compatibility(&self, id: &Uuid) -> PluginTransitionResult
fn check_plugin_compatibility(&self, id: &Uuid) -> PluginTransitionResult
Performs a compatibility check on the plugin with the given id.
The compatibility check depends on the plugin declaration.
If the plugin is incompatible corresponding error messages will appear and the plugin will be uninstalled.
Sourcefn load_plugin_dependencies(&self, id: &Uuid) -> PluginTransitionResult
fn load_plugin_dependencies(&self, id: &Uuid) -> PluginTransitionResult
Loads the dependencies of the plugin with the given id.
The list of dependencies depends on the plugin declaration.
Sourcefn get_dependency_state(&self, dependency: &PluginDependency) -> PluginState
fn get_dependency_state(&self, dependency: &PluginDependency) -> PluginState
Returns the state of the plugin with the given dependency coordinate.
Sourcefn has_dependencies(&self, id: &Uuid) -> bool
fn has_dependencies(&self, id: &Uuid) -> bool
Returns true, if the plugin with the given id has one or multiple dependencies.
Sourcefn get_dependencies(&self, id: &Uuid) -> DashSet<PluginDependency>
fn get_dependencies(&self, id: &Uuid) -> DashSet<PluginDependency>
Returns a list of dependency coordinates for the plugin with the given id.
Sourcefn has_unsatisfied_dependencies(&self, id: &Uuid) -> bool
fn has_unsatisfied_dependencies(&self, id: &Uuid) -> bool
Returns true, if the plugin with the given id has unsatisfied dependencies.
Sourcefn get_unsatisfied_dependencies(&self, id: &Uuid) -> DashSet<PluginDependency>
fn get_unsatisfied_dependencies(&self, id: &Uuid) -> DashSet<PluginDependency>
Returns a list of unsatisfied dependencies of the plugin with the given id.
Sourcefn get_dependents(&self, id: &Uuid) -> Vec<Uuid>
fn get_dependents(&self, id: &Uuid) -> Vec<Uuid>
Returns a list of plugin ids which are dependents of the plugin with the given id.
Sourcefn set_state(&self, id: &Uuid, new_state: PluginState) -> PluginTransitionResult
fn set_state(&self, id: &Uuid, new_state: PluginState) -> PluginTransitionResult
Sets the given new state of the plugin with the given id.
Sourcefn resolve_dependencies_state(
&self,
id: &Uuid,
refreshing: bool,
) -> PluginTransitionResult
fn resolve_dependencies_state( &self, id: &Uuid, refreshing: bool, ) -> PluginTransitionResult
Calculates the state of the dependencies of the plugin with the given id.
Sourcefn construct_proxy(
&self,
id: &Uuid,
plugin_context: Arc<dyn PluginContext + Send + Sync>,
) -> PluginTransitionResult
fn construct_proxy( &self, id: &Uuid, plugin_context: Arc<dyn PluginContext + Send + Sync>, ) -> PluginTransitionResult
Constructs a plugin proxy object for the plugin with the given id.
The plugin proxy makes sure it can’t outlive the library it came from.
Sourcefn register(&self, id: &Uuid) -> PluginTransitionResult
fn register(&self, id: &Uuid) -> PluginTransitionResult
Registers providers of the plugin with the given id.
Sourcefn activate<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = PluginTransitionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn activate<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = PluginTransitionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Calls the activate method of the plugin with the given id.
Sourcefn are_all_stopped(&self) -> bool
fn are_all_stopped(&self) -> bool
Returns true, if all plugins are stopped.
Plugins are considered as stopped if they are not starting, not active and not stopping.
Sourcefn deactivate<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = PluginTransitionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn deactivate<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 Uuid,
) -> Pin<Box<dyn Future<Output = PluginTransitionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Calls the deactivate method of the plugin with the given id.
Sourcefn unregister(&self, id: &Uuid) -> PluginTransitionResult
fn unregister(&self, id: &Uuid) -> PluginTransitionResult
Unregisters the providers of the plugin with the given id.
Sourcefn remove_proxy(&self, id: &Uuid) -> PluginTransitionResult
fn remove_proxy(&self, id: &Uuid) -> PluginTransitionResult
Removes the plugin proxy of the plugin with the given id.
Sourcefn unload_dll(&self, id: &Uuid) -> PluginTransitionResult
fn unload_dll(&self, id: &Uuid) -> PluginTransitionResult
Closes the library by dropping it.
Sourcefn uninstall_dll(&self, id: &Uuid) -> PluginTransitionResult
fn uninstall_dll(&self, id: &Uuid) -> PluginTransitionResult
Deletes the dynamically linked library file.
Sourcefn start_by_stem(&self, stem: &str) -> Result<(), PluginStartError>
fn start_by_stem(&self, stem: &str) -> Result<(), PluginStartError>
Starts the plugin with the given file stem.
Sourcefn start_dependent_with_satisfied_dependencies(&self, id: &Uuid) -> bool
fn start_dependent_with_satisfied_dependencies(&self, id: &Uuid) -> bool
Starts all plugins which are dependent of the plugin with the given id and have no unsatisfied dependencies.
Sourcefn stop(&self, id: &Uuid) -> Result<(), PluginStopError>
fn stop(&self, id: &Uuid) -> Result<(), PluginStopError>
Stops the given plugin. Recursively stops all plugins which depends on the stopped plugin.
Sourcefn stop_by_stem(&self, stem: &str) -> Result<(), PluginStopError>
fn stop_by_stem(&self, stem: &str) -> Result<(), PluginStopError>
Stops the plugin with the given file stem.
Sourcefn stop_active_with_unsatisfied_dependencies(&self) -> bool
fn stop_active_with_unsatisfied_dependencies(&self) -> bool
Stops active plugins which have unsatisfied dependencies.
Sourcefn uninstall(&self, id: &Uuid) -> Result<(), PluginUninstallError>
fn uninstall(&self, id: &Uuid) -> Result<(), PluginUninstallError>
Uninstalls the plugin with the given id.