pub(crate) struct Plugins {
plugins: HashMap<TypeId, Arc<Mutex<PluginHandle>>>,
plugins_ordered: PluginsOrdered,
}Expand description
User-registered plugins.
Fields§
§plugins: HashMap<TypeId, Arc<Mutex<PluginHandle>>>§plugins_ordered: PluginsOrderedImplementations§
Source§impl Plugins
impl Plugins
pub fn ordered_plugins(&self) -> PluginsOrdered
Sourcepub fn add(&mut self, handle: Arc<Mutex<PluginHandle>>) -> bool
pub fn add(&mut self, handle: Arc<Mutex<PluginHandle>>) -> bool
Remember to call Plugin::setup on the plugin after adding it.
Will not add the plugin if a plugin of the same type already exists.
Returns false if the plugin was not added, true if it was added.
pub fn get(&self, type_id: TypeId) -> Option<Arc<Mutex<PluginHandle>>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Plugins
impl !RefUnwindSafe for Plugins
impl Send for Plugins
impl Sync for Plugins
impl Unpin for Plugins
impl !UnwindSafe for Plugins
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