pub struct PluginManager { /* private fields */ }Expand description
Manager for plugins.
Implementations§
Source§impl PluginManager
impl PluginManager
Sourcepub fn new(ctx: Arc<NargoContext>) -> Self
pub fn new(ctx: Arc<NargoContext>) -> Self
Creates a new plugin manager.
Sourcepub fn register_with_config(
&mut self,
plugin: Box<dyn Plugin>,
config: PluginConfig,
)
pub fn register_with_config( &mut self, plugin: Box<dyn Plugin>, config: PluginConfig, )
Registers a plugin with custom config.
Sourcepub async fn parse(&self, source: String) -> Result<String>
pub async fn parse(&self, source: String) -> Result<String>
Processes source code through all registered plugins at parse phase.
Sourcepub async fn transform(&self, code: String) -> Result<String>
pub async fn transform(&self, code: String) -> Result<String>
Transforms code through all registered plugins.
Sourcepub async fn bundle(&self, bundle: String) -> Result<String>
pub async fn bundle(&self, bundle: String) -> Result<String>
Bundles code through all registered plugins.
Sourcepub fn cleanup_all(&self) -> Result<()>
pub fn cleanup_all(&self) -> Result<()>
Cleans up all registered plugins.
Sourcepub fn get_config(&self, name: &str) -> Option<&PluginConfig>
pub fn get_config(&self, name: &str) -> Option<&PluginConfig>
Gets a plugin config by name.
Sourcepub fn set_plugin_enabled(&mut self, name: &str, enabled: bool) -> Result<()>
pub fn set_plugin_enabled(&mut self, name: &str, enabled: bool) -> Result<()>
Enables or disables a plugin.
Sourcepub fn get_plugins_info(&self) -> Vec<(&str, &PluginConfig)>
pub fn get_plugins_info(&self) -> Vec<(&str, &PluginConfig)>
Gets all plugins info.
Auto Trait Implementations§
impl Freeze for PluginManager
impl !RefUnwindSafe for PluginManager
impl Send for PluginManager
impl Sync for PluginManager
impl Unpin for PluginManager
impl UnsafeUnpin for PluginManager
impl !UnwindSafe for PluginManager
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