pub struct PluginRegistry { /* private fields */ }Expand description
Registry of loaded plugins.
Parallel to ToolRegistry in astrid-tools. Stores plugins keyed by
their PluginId and provides cross-plugin tool lookup.
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn register(&mut self, plugin: Box<dyn Plugin>) -> PluginResult<()>
pub fn register(&mut self, plugin: Box<dyn Plugin>) -> PluginResult<()>
Register a plugin.
§Errors
Returns PluginError::AlreadyRegistered if a plugin with the same
ID is already in the registry.
Sourcepub fn unregister(&mut self, id: &PluginId) -> PluginResult<Box<dyn Plugin>>
pub fn unregister(&mut self, id: &PluginId) -> PluginResult<Box<dyn Plugin>>
Unregister a plugin, returning it if it was present.
§Errors
Returns PluginError::NotFound if no plugin with the given ID exists.
Sourcepub fn get_mut(&mut self, id: &PluginId) -> Option<&mut Box<dyn Plugin>>
pub fn get_mut(&mut self, id: &PluginId) -> Option<&mut Box<dyn Plugin>>
Get a mutable reference to a plugin by ID.
Sourcepub fn find_tool(
&self,
qualified_name: &str,
) -> Option<(&dyn Plugin, &dyn PluginTool)>
pub fn find_tool( &self, qualified_name: &str, ) -> Option<(&dyn Plugin, &dyn PluginTool)>
Find a tool by its fully qualified name (plugin:{plugin_id}:{tool_name}).
Returns the plugin and tool if found.
Sourcepub fn is_plugin_tool(name: &str) -> bool
pub fn is_plugin_tool(name: &str) -> bool
Check if a tool name refers to a plugin tool (has two colons with plugin: prefix).
Sourcepub fn all_tool_definitions(&self) -> Vec<PluginToolDefinition>
pub fn all_tool_definitions(&self) -> Vec<PluginToolDefinition>
Export all tool definitions from all plugins for the LLM.
Trait Implementations§
Source§impl Debug for PluginRegistry
impl Debug for PluginRegistry
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
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more