Trait PluginContainerManager

Source
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§

Source

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.

Source

fn remove_plugin_container(&self, id: &Uuid)

Returns the plugin with the given id from the list of plugin containers.

Source

fn has(&self, stem: &str) -> bool

Returns true, if a plugin with the given file stem exists.

Source

fn get_id(&self, stem: &str) -> Option<Uuid>

Returns the id of the plugin with the given file stem.

Source

fn get_stem(&self, id: &Uuid) -> Option<String>

Returns the file stem of the plugin with the given id.

Source

fn name(&self, id: &Uuid) -> Option<String>

Returns the name of the plugin with the given id.

Source

fn name_canonicalized(&self, id: &Uuid) -> Option<String>

Returns the canonicalized name of the plugin with the given id.

Source

fn name_version(&self, id: &Uuid) -> Option<String>

Returns the canonicalized name and version of the plugin with the given id.

Source

fn description(&self, id: &Uuid) -> Option<String>

Returns the description of the plugin with the given id.

Source

fn version(&self, id: &Uuid) -> Option<String>

Returns the version of the plugin with the given id.

Source

fn rustc_version(&self, id: &Uuid) -> Option<String>

Returns the version of the rust compiler the plugin with the given id was compiled with.

Source

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.

Source

fn count(&self) -> usize

Returns the count of all plugins.

Source

fn count_by_state(&self, state: &PluginState) -> usize

Returns the count of plugins with the given state.

Source

fn count_by_states(&self) -> String

Returns a string withs stats abouts the states of the plugins

Source

fn count_by_state_str(&self, state: &PluginState) -> String

Source

fn get_plugin_path(&self, id: &Uuid) -> Option<String>

Returns the path of the plugin with the given id.

Source

fn get_plugin_state(&self, id: &Uuid) -> Option<PluginState>

Returns the state of the plugin with the given id.

Source

fn get_plugins(&self) -> Vec<Uuid>

Returns a list of ids of all plugins.

Source

fn get_plugins_with_state(&self, state: PluginState) -> Vec<Uuid>

Returns a list of ids of plugins with the given state.

Source

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.

Source

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.

Source

fn get_plugin_by_dependency( &self, plugin_dependency: &PluginDependency, ) -> Option<Uuid>

Returns the id of the plugin by a dependency coordinate.

Source

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.

Source

fn load_dll(&self, id: &Uuid) -> PluginTransitionResult

Loads the dynamic linked library into memory.

Source

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’.

Source

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.

Source

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.

Source

fn get_dependency_state(&self, dependency: &PluginDependency) -> PluginState

Returns the state of the plugin with the given dependency coordinate.

Source

fn has_dependencies(&self, id: &Uuid) -> bool

Returns true, if the plugin with the given id has one or multiple dependencies.

Source

fn get_dependencies(&self, id: &Uuid) -> DashSet<PluginDependency>

Returns a list of dependency coordinates for the plugin with the given id.

Source

fn has_unsatisfied_dependencies(&self, id: &Uuid) -> bool

Returns true, if the plugin with the given id has unsatisfied dependencies.

Source

fn get_unsatisfied_dependencies(&self, id: &Uuid) -> DashSet<PluginDependency>

Returns a list of unsatisfied dependencies of the plugin with the given id.

Source

fn get_dependents(&self, id: &Uuid) -> Vec<Uuid>

Returns a list of plugin ids which are dependents of the plugin with the given id.

Source

fn set_state(&self, id: &Uuid, new_state: PluginState) -> PluginTransitionResult

Sets the given new state of the plugin with the given id.

Source

fn resolve_dependencies_state( &self, id: &Uuid, refreshing: bool, ) -> PluginTransitionResult

Calculates the state of the dependencies of the plugin with the given id.

Source

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.

Source

fn register(&self, id: &Uuid) -> PluginTransitionResult

Registers providers of the plugin with the given id.

Source

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.

Source

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.

Source

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.

Source

fn unregister(&self, id: &Uuid) -> PluginTransitionResult

Unregisters the providers of the plugin with the given id.

Source

fn remove_proxy(&self, id: &Uuid) -> PluginTransitionResult

Removes the plugin proxy of the plugin with the given id.

Source

fn unload_dll(&self, id: &Uuid) -> PluginTransitionResult

Closes the library by dropping it.

Source

fn uninstall_dll(&self, id: &Uuid) -> PluginTransitionResult

Deletes the dynamically linked library file.

Source

fn start(&self, id: &Uuid) -> Result<(), PluginStartError>

Start the plugin with the given id.

Source

fn start_by_stem(&self, stem: &str) -> Result<(), PluginStartError>

Starts the plugin with the given file stem.

Source

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.

Source

fn stop(&self, id: &Uuid) -> Result<(), PluginStopError>

Stops the given plugin. Recursively stops all plugins which depends on the stopped plugin.

Source

fn stop_by_stem(&self, stem: &str) -> Result<(), PluginStopError>

Stops the plugin with the given file stem.

Source

fn stop_all(&self)

Stops all plugins.

Source

fn stop_active_with_unsatisfied_dependencies(&self) -> bool

Stops active plugins which have unsatisfied dependencies.

Source

fn uninstall(&self, id: &Uuid) -> Result<(), PluginUninstallError>

Uninstalls the plugin with the given id.

Source

fn redeploy(&self, id: &Uuid) -> Result<(), PluginDeployError>

Redeploys the plugin with the given id.

Source

fn disable(&self, id: &Uuid) -> Result<(), PluginDisableError>

Disables the plugin with the given id.

Trait Implementations§

Source§

impl Injectable for dyn PluginContainerManager + Sync + Send

Implementors§