Struct GCPluginInstance
pub struct GCPluginInstance<T: GCPluginCallbackHandler>(Arc<GCPluginInstanceInner<T>>);Expand description
GCPluginInstance is a reference counted wrapper that holds the PluginRunningInstance,
which contains the resources necessary for the plugin execution, and provides a safe way to interact with it.
This structure can be cloned and shared between threads.
Tuple Fields§
§0: Arc<GCPluginInstanceInner<T>>Implementations§
§impl<T: GCPluginCallbackHandler> GCPluginInstance<T>
impl<T: GCPluginCallbackHandler> GCPluginInstance<T>
pub(crate) fn new(
instance_name: &str,
plugin_name: String,
callback_handler: Box<T>,
) -> Self
pub(crate) fn new( instance_name: &str, plugin_name: String, callback_handler: Box<T>, ) -> Self
Creates a new instance without starting the underlying plugin.
pub(crate) fn init(
&self,
config: GCPluginInstanceConfig<'_>,
plugin_dll: PluginDLL,
) -> Result<(), GCPluginManagerError>
pub(crate) fn init( &self, config: GCPluginInstanceConfig<'_>, plugin_dll: PluginDLL, ) -> Result<(), GCPluginManagerError>
Starts the plugin instance.
This function should not be exposed to the rest of the application. Each instance should be initialized by the GCPluginManager instead. This function assumes that EVERY plugin instance name are unique!
Attempts to start an instance belonging to a different plugin DLL will result in an ErrorPluginMismatch.
pub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the plugin instance is running.
pub fn get_instance_name(&self) -> &str
pub fn get_instance_name(&self) -> &str
Get the instance name
pub fn get_plugin_name(&self) -> &str
pub fn get_plugin_name(&self) -> &str
Get the plugin DLL name
pub fn get_plugin_info(&self) -> Option<GCPluginInfo>
pub fn get_plugin_info(&self) -> Option<GCPluginInfo>
Get the plugin info
This only returns the plugin info if the plugin instance is running. If the info is required even when instance is not running consider using the GCPlugin instead.