pub struct PluginRegistry { /* private fields */ }Expand description
Registry that holds all loaded plugins.
Provides lifecycle management (init/shutdown), plugin lookup, and aggregation of routes and tools from all registered plugins.
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn register(&mut self, plugin: Arc<dyn Plugin>) -> Result<()>
pub fn register(&mut self, plugin: Arc<dyn Plugin>) -> Result<()>
Register a plugin. Returns an error if a plugin with the same id already exists.
§Errors
Returns an error if a plugin with a duplicate id is registered.
Sourcepub async fn init_all(&self) -> Result<()>
pub async fn init_all(&self) -> Result<()>
Initialize all plugins in registration order.
§Errors
Returns the first plugin initialization error encountered.
Sourcepub async fn shutdown_all(&self) -> Result<()>
pub async fn shutdown_all(&self) -> Result<()>
Shutdown all plugins in reverse registration order.
§Errors
Returns the first plugin shutdown error encountered.
Sourcepub fn collect_routes(&self) -> Router
pub fn collect_routes(&self) -> Router
Collect all plugin routes into a single merged axum Router.
Each plugin’s routes are nested under /{plugin_id}.
Sourcepub fn collect_tools(&self) -> ToolRegistry
pub fn collect_tools(&self) -> ToolRegistry
Collect all plugin tools into a single ToolRegistry.
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