pub trait RegisteredPlugin: Send + Sync {
// Required methods
fn identity(&self) -> &PluginIdentity;
fn is_running(&self) -> bool;
fn pid(&self) -> Option<u32>;
fn metadata(&self) -> Option<PluginMetadata>;
fn set_metadata(&self, metadata: Option<PluginMetadata>);
fn set_gc_config(&self, gc_config: &PluginGcConfig);
fn stop(&self) -> Result<(), ShellError>;
fn reset(&self) -> Result<(), ShellError>;
fn as_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync>;
// Provided method
fn configure_signal_handler(
self: Arc<Self>,
_handler: &Handlers,
) -> Result<(), ShellError> { ... }
}Expand description
Trait for plugins registered in the EngineState.
Required Methods§
Sourcefn identity(&self) -> &PluginIdentity
fn identity(&self) -> &PluginIdentity
The identity of the plugin - its filename, shell, and friendly name.
Sourcefn is_running(&self) -> bool
fn is_running(&self) -> bool
True if the plugin is currently running.
Sourcefn metadata(&self) -> Option<PluginMetadata>
fn metadata(&self) -> Option<PluginMetadata>
Get metadata for the plugin, if set.
Sourcefn set_metadata(&self, metadata: Option<PluginMetadata>)
fn set_metadata(&self, metadata: Option<PluginMetadata>)
Set metadata for the plugin.
Sourcefn set_gc_config(&self, gc_config: &PluginGcConfig)
fn set_gc_config(&self, gc_config: &PluginGcConfig)
Set garbage collection config for the plugin.
Sourcefn stop(&self) -> Result<(), ShellError>
fn stop(&self) -> Result<(), ShellError>
Stop the plugin.
Sourcefn reset(&self) -> Result<(), ShellError>
fn reset(&self) -> Result<(), ShellError>
Stop the plugin and reset any state so that we don’t make any assumptions about the plugin
next time it launches. This is used on plugin add.
Provided Methods§
Sourcefn configure_signal_handler(
self: Arc<Self>,
_handler: &Handlers,
) -> Result<(), ShellError>
fn configure_signal_handler( self: Arc<Self>, _handler: &Handlers, ) -> Result<(), ShellError>
Give this plugin a chance to register for Ctrl-C signals.