pub struct PluginStore {
pub plugins: Vec<Plugin>,
}Expand description
Storage for plugin configurations
Fields§
§plugins: Vec<Plugin>Implementations§
Source§impl PluginStore
impl PluginStore
Sourcepub fn plugins_path() -> PathBuf
pub fn plugins_path() -> PathBuf
Get plugins path
Sourcepub fn add_plugin(&mut self, plugin: Plugin) -> Result<()>
pub fn add_plugin(&mut self, plugin: Plugin) -> Result<()>
Add a plugin
Sourcepub fn remove_plugin(&mut self, name: &str) -> Result<()>
pub fn remove_plugin(&mut self, name: &str) -> Result<()>
Remove a plugin by name
Sourcepub fn get_plugin(&self, name: &str) -> Option<&Plugin>
pub fn get_plugin(&self, name: &str) -> Option<&Plugin>
Get a plugin by name
Sourcepub fn get_plugin_mut(&mut self, name: &str) -> Option<&mut Plugin>
pub fn get_plugin_mut(&mut self, name: &str) -> Option<&mut Plugin>
Get a mutable plugin by name
Sourcepub fn list_plugins(&self) -> &[Plugin]
pub fn list_plugins(&self) -> &[Plugin]
List all plugins
Sourcepub fn enable_plugin(&mut self, name: &str) -> Result<()>
pub fn enable_plugin(&mut self, name: &str) -> Result<()>
Enable a plugin
Sourcepub fn disable_plugin(&mut self, name: &str) -> Result<()>
pub fn disable_plugin(&mut self, name: &str) -> Result<()>
Disable a plugin
Trait Implementations§
Source§impl Clone for PluginStore
impl Clone for PluginStore
Source§fn clone(&self) -> PluginStore
fn clone(&self) -> PluginStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PluginStore
impl Debug for PluginStore
Source§impl Default for PluginStore
impl Default for PluginStore
Source§fn default() -> PluginStore
fn default() -> PluginStore
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PluginStore
impl<'de> Deserialize<'de> for PluginStore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PluginStore
impl RefUnwindSafe for PluginStore
impl Send for PluginStore
impl Sync for PluginStore
impl Unpin for PluginStore
impl UnsafeUnpin for PluginStore
impl UnwindSafe for PluginStore
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