pub struct PluginManager { /* private fields */ }Expand description
Plugin manager for registering and coordinating plugins.
The manager handles:
- Plugin registration with priority sorting
- Active plugin priority (a plugin processing multi-line content)
- Flushing all plugins at end of stream
Implementations§
Source§impl PluginManager
impl PluginManager
Sourcepub fn with_builtins() -> Self
pub fn with_builtins() -> Self
Create a plugin manager with built-in plugins.
Sourcepub fn register(&mut self, plugin: Box<dyn Plugin>)
pub fn register(&mut self, plugin: Box<dyn Plugin>)
Register a plugin.
Plugins are sorted by priority after registration.
Sourcepub fn plugin_count(&self) -> usize
pub fn plugin_count(&self) -> usize
Get the number of registered plugins.
Sourcepub fn plugin_names(&self) -> Vec<&str>
pub fn plugin_names(&self) -> Vec<&str>
Get plugin names.
Sourcepub fn process_line(
&mut self,
line: &str,
state: &ParseState,
style: &ComputedStyle,
) -> Option<Vec<String>>
pub fn process_line( &mut self, line: &str, state: &ParseState, style: &ComputedStyle, ) -> Option<Vec<String>>
Process a line through registered plugins.
§Returns
None: No plugin handled the line, continue normal processingSome(vec): Plugin produced these lines, skip normal processing
Sourcepub fn flush(&mut self) -> Vec<String>
pub fn flush(&mut self) -> Vec<String>
Flush all plugins at end of stream.
Returns all remaining buffered content from all plugins.
Sourcepub fn has_active_plugin(&self) -> bool
pub fn has_active_plugin(&self) -> bool
Check if any plugin is currently active.
Sourcepub fn active_plugin_name(&self) -> Option<&str>
pub fn active_plugin_name(&self) -> Option<&str>
Get the name of the active plugin, if any.
Trait Implementations§
Source§impl Default for PluginManager
impl Default for PluginManager
Source§fn default() -> PluginManager
fn default() -> PluginManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PluginManager
impl !RefUnwindSafe for PluginManager
impl Send for PluginManager
impl Sync for PluginManager
impl Unpin 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