Struct GCPlugin
pub struct GCPlugin<T: GCPluginCallbackHandler> {
plugin_instances: HashMap<String, GCPluginInstance<T>>,
lib: PluginDLL,
}Expand description
GCPlugin holds the plugin instances for a particular plugin library.
Fields§
§plugin_instances: HashMap<String, GCPluginInstance<T>>§lib: PluginDLLImplementations§
§impl<T: GCPluginCallbackHandler> GCPlugin<T>
impl<T: GCPluginCallbackHandler> GCPlugin<T>
pub(crate) fn new(lib: PathBuf) -> Result<Self, GCPluginManagerError>
pub(crate) fn new(lib: PathBuf) -> Result<Self, GCPluginManagerError>
Creates a new plugin by loading it’s DLL using GCPluginDLL.
pub(crate) fn add_instance(
&mut self,
instance_name: &str,
callback_handler: Box<T>,
) -> Result<GCPluginInstance<T>, GCPluginManagerError>
pub(crate) fn add_instance( &mut self, instance_name: &str, callback_handler: Box<T>, ) -> Result<GCPluginInstance<T>, GCPluginManagerError>
Adds a new instance to the plugin without starting it.
pub(crate) fn stop_instance( &self, instance_name: &str, ) -> Result<(), GCPluginManagerError>
pub(crate) fn start_instance(
&mut self,
config: GCPluginInstanceConfig<'_>,
instance_name: &str,
) -> Result<GCPluginInstance<T>, GCPluginManagerError>
pub(crate) fn start_instance( &mut self, config: GCPluginInstanceConfig<'_>, instance_name: &str, ) -> Result<GCPluginInstance<T>, GCPluginManagerError>
Starts the instance by initializing it with the given configuration and callback handler.
pub(crate) fn remove_instance(
&mut self,
instance_name: &str,
) -> Result<(), GCPluginManagerError>
pub(crate) fn remove_instance( &mut self, instance_name: &str, ) -> Result<(), GCPluginManagerError>
This function will remove the instance from the plugin and shutdown the instance.
pub(crate) fn get_plugin_dll(&self) -> &PluginDLL
pub(crate) fn get_plugin_dll(&self) -> &PluginDLL
Returns the plugin DLL.
pub fn get_plugin_info(&self) -> GCPluginInfo
pub fn get_plugin_info(&self) -> GCPluginInfo
Returns the plugin info by calling gc_plugin_get_info
pub fn get_num_instances(&self) -> usize
pub fn get_num_instances(&self) -> usize
Returns the number of instances for this plugin.
pub fn get_plugin_path(&self) -> &Path
pub fn get_plugin_path(&self) -> &Path
Returns the path to the plugin DLL.
pub fn iter(&self) -> impl Iterator<Item = &GCPluginInstance<T>>
pub fn iter(&self) -> impl Iterator<Item = &GCPluginInstance<T>>
Returns an iterator over all instances for this plugin.
pub fn get_instance(&self, instance_name: &str) -> Option<&GCPluginInstance<T>>
Trait Implementations§
§impl<T: GCPluginCallbackHandler> Debug for GCPlugin<T>
impl<T: GCPluginCallbackHandler> Debug for GCPlugin<T>
Auto Trait Implementations§
impl<T> Freeze for GCPlugin<T>
impl<T> RefUnwindSafe for GCPlugin<T>where
T: RefUnwindSafe,
impl<T> Send for GCPlugin<T>
impl<T> Sync for GCPlugin<T>
impl<T> Unpin for GCPlugin<T>
impl<T> UnsafeUnpin for GCPlugin<T>
impl<T> UnwindSafe for GCPlugin<T>where
T: RefUnwindSafe,
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
Mutably borrows from an owned value. Read more