pub struct PluginRepository { /* private fields */ }
Expand description
§Plugin Repository
A repository to manage plugins, it stores plugin definitions and instances.
You can get a global instance through PluginRepository::global
.
Implementations§
Source§impl PluginRepository
impl PluginRepository
Sourcepub fn global() -> &'static Self
pub fn global() -> &'static Self
Get a global instance of this repository.
Once the repository is initialized, it will register all plugins in this crate.
Sourcepub fn register_prelude(&self)
pub fn register_prelude(&self)
register all plugins in this crates
Sourcepub fn register_custom<A: Into<PluginDefinitionObject>>(&self, attr: A)
pub fn register_custom<A: Into<PluginDefinitionObject>>(&self, attr: A)
register a custom plugin
Sourcepub fn clear_instances(&self)
pub fn clear_instances(&self)
clear all instances
Sourcepub fn create_or_update_instance(
&self,
config: PluginConfig,
) -> Result<(), BoxError>
pub fn create_or_update_instance( &self, config: PluginConfig, ) -> Result<(), BoxError>
create or update a plugin instance by config
Sourcepub fn remove_instance(
&self,
id: &PluginInstanceId,
) -> Result<HashSet<MountPointIndex>, BoxError>
pub fn remove_instance( &self, id: &PluginInstanceId, ) -> Result<HashSet<MountPointIndex>, BoxError>
remove a plugin instance by id
Sourcepub fn mount<M: MountPoint>(
&self,
mount_point: &mut M,
mount_index: MountPointIndex,
id: PluginInstanceId,
) -> Result<(), BoxError>
pub fn mount<M: MountPoint>( &self, mount_point: &mut M, mount_index: MountPointIndex, id: PluginInstanceId, ) -> Result<(), BoxError>
mount a plugin instance to a mount point
pub fn instance_snapshot( &self, id: PluginInstanceId, ) -> Option<PluginInstanceSnapshot>
pub fn plugin_list(&self) -> Vec<PluginAttributes>
Sourcepub fn repo_snapshot(&self) -> HashMap<String, PluginRepoSnapshot>
pub fn repo_snapshot(&self) -> HashMap<String, PluginRepoSnapshot>
Get a snapshot for repository plugins
Trait Implementations§
Source§impl Clone for PluginRepository
impl Clone for PluginRepository
Source§fn clone(&self) -> PluginRepository
fn clone(&self) -> PluginRepository
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 Default for PluginRepository
impl Default for PluginRepository
Source§fn default() -> PluginRepository
fn default() -> PluginRepository
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PluginRepository
impl RefUnwindSafe for PluginRepository
impl Send for PluginRepository
impl Sync for PluginRepository
impl Unpin for PluginRepository
impl UnwindSafe for PluginRepository
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