pub struct PluginContainer {
pub id: Uuid,
pub stem: String,
pub path: PathBuf,
pub state: PluginState,
pub plugin_declaration: RwLock<Option<PluginDeclaration>>,
pub proxy: Arc<RwLock<Option<Arc<PluginProxy>>>>,
pub library: RwLock<Option<Arc<Library>>>,
pub dependencies: DashSet<PluginDependency>,
}
Expand description
The plugin container holds the meta information and the library.
Fields§
§id: Uuid
The id.
stem: String
The filename stem (actually the file_prefix). Does not contain the timestamp and the file extension.
path: PathBuf
The path of the plugin in the file system. The plugin is located in the installation directory.
state: PluginState
The state of the plugin.
plugin_declaration: RwLock<Option<PluginDeclaration>>
The plugin declaration.
proxy: Arc<RwLock<Option<Arc<PluginProxy>>>>
The plugin context.
library: RwLock<Option<Arc<Library>>>
The loaded library.
dependencies: DashSet<PluginDependency>
The dependencies of the plugin.
Implementations§
Source§impl PluginContainer
impl PluginContainer
pub fn new(stem: String, path: PathBuf) -> Self
Sourcepub fn deploy_dll(&mut self) -> PluginTransitionResult
pub fn deploy_dll(&mut self) -> PluginTransitionResult
Moves the file from the deploy directory to the installed directory
Sourcepub fn load_dll(&mut self) -> PluginTransitionResult
pub fn load_dll(&mut self) -> PluginTransitionResult
Loads the dynamic link library into memory.
Sourcepub fn unload_dll(&mut self) -> PluginTransitionResult
pub fn unload_dll(&mut self) -> PluginTransitionResult
Unloads the dynamic link library.
Sourcepub fn uninstall_dll(&mut self) -> PluginTransitionResult
pub fn uninstall_dll(&mut self) -> PluginTransitionResult
Uninstalls the dynamic link library by removing the file from the plugin folder.
Sourcepub fn load_plugin_declaration(&mut self) -> PluginTransitionResult
pub fn load_plugin_declaration(&mut self) -> PluginTransitionResult
Loads the plugin declaration from the dynamic link library. The plugin declaration contains version information and a registration method.
Sourcepub fn check_compatibility(&mut self) -> PluginTransitionResult
pub fn check_compatibility(&mut self) -> PluginTransitionResult
Checks for compatibility.
pub fn load_plugin_dependencies(&mut self) -> PluginTransitionResult
Sourcepub fn construct_proxy(
&mut self,
plugin_context: Arc<dyn PluginContext + Send + Sync>,
) -> PluginTransitionResult
pub fn construct_proxy( &mut self, plugin_context: Arc<dyn PluginContext + Send + Sync>, ) -> PluginTransitionResult
Constructs the proxy for the plugin.
Sourcepub async fn activate(&mut self) -> PluginTransitionResult
pub async fn activate(&mut self) -> PluginTransitionResult
Calls the activate method of the plugin.
Sourcepub async fn deactivate(&mut self) -> PluginTransitionResult
pub async fn deactivate(&mut self) -> PluginTransitionResult
Calls the deactivate method of the plugin
Sourcepub fn remove_proxy(&mut self) -> PluginTransitionResult
pub fn remove_proxy(&mut self) -> PluginTransitionResult
Removes the proxy from the plugin.
pub fn stop(&mut self) -> Result<(), PluginStopError>
pub fn uninstall(&mut self) -> Result<(), PluginUninstallError>
pub fn redeploy(&mut self) -> Result<(), PluginDeployError>
pub fn disable(&mut self) -> Result<(), PluginDisableError>
pub fn name(&self) -> Option<String>
pub fn name_canonicalized(&self) -> Option<String>
pub fn name_version(&self) -> Option<String>
pub fn description(&self) -> Option<String>
pub fn version(&self) -> Option<String>
pub fn rustc_version(&self) -> Option<String>
pub fn plugin_api_version(&self) -> Option<String>
Auto Trait Implementations§
impl !Freeze for PluginContainer
impl !RefUnwindSafe for PluginContainer
impl Send for PluginContainer
impl Sync for PluginContainer
impl Unpin for PluginContainer
impl UnwindSafe for PluginContainer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more