pub struct PluginRegistry { /* private fields */ }Expand description
Manages loaded plugins and dispatches lifecycle events in registration order.
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
pub fn new() -> Self
Sourcepub fn register(&mut self, plugin: Box<dyn Plugin>)
pub fn register(&mut self, plugin: Box<dyn Plugin>)
Register a plugin. Plugins are dispatched in registration order.
Sourcepub fn register_all(&mut self, plugins: Vec<Box<dyn Plugin>>)
pub fn register_all(&mut self, plugins: Vec<Box<dyn Plugin>>)
Register multiple plugins at once, preserving order.
Sourcepub fn plugin_names(&self) -> Vec<&str>
pub fn plugin_names(&self) -> Vec<&str>
Returns the names of all registered plugins.
Sourcepub async fn dispatch_init(
&self,
config: &SiteConfig,
plugin_options: &HashMap<String, HashMap<String, Value>>,
) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn dispatch_init( &self, config: &SiteConfig, plugin_options: &HashMap<String, HashMap<String, Value>>, ) -> Result<(), Box<dyn Error + Send + Sync>>
Dispatch on_init to all plugins in order.
Sourcepub async fn dispatch_build_start(
&self,
config: &SiteConfig,
store: &ContentStore,
) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn dispatch_build_start( &self, config: &SiteConfig, store: &ContentStore, ) -> Result<(), Box<dyn Error + Send + Sync>>
Dispatch on_build_start to all plugins in order.
Sourcepub async fn dispatch_content_parsed(
&self,
config: &SiteConfig,
page: &mut PageData,
) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn dispatch_content_parsed( &self, config: &SiteConfig, page: &mut PageData, ) -> Result<(), Box<dyn Error + Send + Sync>>
Dispatch on_content_parsed to all plugins in order for a single page.
Sourcepub async fn dispatch_graph_updated(
&self,
config: &SiteConfig,
store: &ContentStore,
) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn dispatch_graph_updated( &self, config: &SiteConfig, store: &ContentStore, ) -> Result<(), Box<dyn Error + Send + Sync>>
Dispatch on_graph_updated to all plugins in order.
Sourcepub async fn dispatch_validation_complete(
&self,
config: &SiteConfig,
store: &ContentStore,
conforms: bool,
violations: usize,
) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn dispatch_validation_complete( &self, config: &SiteConfig, store: &ContentStore, conforms: bool, violations: usize, ) -> Result<(), Box<dyn Error + Send + Sync>>
Dispatch on_validation_complete to all plugins in order.
Sourcepub async fn dispatch_page_render(
&self,
config: &SiteConfig,
store: &ContentStore,
page: &mut PageData,
extra_vars: &mut HashMap<String, Value>,
) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn dispatch_page_render( &self, config: &SiteConfig, store: &ContentStore, page: &mut PageData, extra_vars: &mut HashMap<String, Value>, ) -> Result<(), Box<dyn Error + Send + Sync>>
Dispatch on_page_render to all plugins in order for a single page.
Sourcepub async fn dispatch_build_complete(
&self,
config: &SiteConfig,
store: &ContentStore,
outputs: &HashMap<String, String>,
output_dir: &Utf8Path,
) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn dispatch_build_complete( &self, config: &SiteConfig, store: &ContentStore, outputs: &HashMap<String, String>, output_dir: &Utf8Path, ) -> Result<(), Box<dyn Error + Send + Sync>>
Dispatch on_build_complete to all plugins in order.
Sourcepub async fn dispatch_file_changed(
&self,
config: &SiteConfig,
changed_path: &str,
) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn dispatch_file_changed( &self, config: &SiteConfig, changed_path: &str, ) -> Result<(), Box<dyn Error + Send + Sync>>
Dispatch on_file_changed to all plugins in order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PluginRegistry
impl !RefUnwindSafe for PluginRegistry
impl Send for PluginRegistry
impl Sync for PluginRegistry
impl Unpin for PluginRegistry
impl UnsafeUnpin for PluginRegistry
impl !UnwindSafe for PluginRegistry
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