pub struct ExtensionRegistry { /* private fields */ }Expand description
pub.
Implementations§
Source§impl ExtensionRegistry
impl ExtensionRegistry
Sourcepub fn unregister(&mut self, name: &str) -> bool
pub fn unregister(&mut self, name: &str) -> bool
Unregister an extension by name.
Sourcepub fn disable(&mut self, name: &str) -> Result<(), ExtensionError>
pub fn disable(&mut self, name: &str) -> Result<(), ExtensionError>
Disable an extension (keeps it registered but inactive).
Sourcepub fn enable(
&mut self,
name: &str,
ctx: &ExtensionContext,
) -> Result<(), ExtensionError>
pub fn enable( &mut self, name: &str, ctx: &ExtensionContext, ) -> Result<(), ExtensionError>
Enable a previously disabled extension.
Sourcepub fn is_enabled(&self, name: &str) -> bool
pub fn is_enabled(&self, name: &str) -> bool
Check if an extension is enabled.
Sourcepub fn all_tools(&self) -> Vec<Arc<dyn AgentTool>>
pub fn all_tools(&self) -> Vec<Arc<dyn AgentTool>>
Collect all tools from all enabled extensions.
Sourcepub fn all_commands(&self) -> Vec<Command>
pub fn all_commands(&self) -> Vec<Command>
Collect all commands from all enabled extensions.
Sourcepub fn emit_load(&self, ctx: &ExtensionContext)
pub fn emit_load(&self, ctx: &ExtensionContext)
Emit on_load to all enabled extensions.
Sourcepub fn emit_unload(&self)
pub fn emit_unload(&self)
Emit on_unload to all enabled extensions.
Sourcepub fn emit_message_sent(&self, msg: &str)
pub fn emit_message_sent(&self, msg: &str)
Emit on_message_sent to all enabled extensions.
Sourcepub fn emit_message_received(&self, msg: &str)
pub fn emit_message_received(&self, msg: &str)
Emit on_message_received to all enabled extensions.
Sourcepub fn emit_tool_call(&self, tool: &str, params: &Value)
pub fn emit_tool_call(&self, tool: &str, params: &Value)
Emit on_tool_call to all enabled extensions.
Sourcepub fn emit_tool_result(&self, tool: &str, result: &AgentToolResult)
pub fn emit_tool_result(&self, tool: &str, result: &AgentToolResult)
Emit on_tool_result to all enabled extensions.
Sourcepub fn emit_session_start(&self, session_id: &str)
pub fn emit_session_start(&self, session_id: &str)
Emit on_session_start to all enabled extensions.
Sourcepub fn emit_session_end(&self, session_id: &str)
pub fn emit_session_end(&self, session_id: &str)
Emit on_session_end to all enabled extensions.
Sourcepub fn emit_settings_changed(&self, settings: &Settings)
pub fn emit_settings_changed(&self, settings: &Settings)
Emit on_settings_changed to all enabled extensions.
Sourcepub fn emit_event(&self, event: &AgentEvent)
pub fn emit_event(&self, event: &AgentEvent)
Emit on_event to all enabled extensions.
Sourcepub fn emit_error(&self, error: &Error) -> Vec<(String, Error)>
pub fn emit_error(&self, error: &Error) -> Vec<(String, Error)>
Emit on_error to all enabled extensions.
Sourcepub fn emit_session_shutdown(&self, event: &SessionShutdownEvent)
pub fn emit_session_shutdown(&self, event: &SessionShutdownEvent)
Emit session_shutdown to all enabled extensions.
Sourcepub fn extensions(&self) -> impl Iterator<Item = &Arc<dyn Extension>>
pub fn extensions(&self) -> impl Iterator<Item = &Arc<dyn Extension>>
Iterate over all extensions.
Sourcepub fn manifest(&self, name: &str) -> Option<ExtensionManifest>
pub fn manifest(&self, name: &str) -> Option<ExtensionManifest>
Get manifest for an extension.
Sourcepub fn errors(&self) -> Vec<ExtensionErrorRecord>
pub fn errors(&self) -> Vec<ExtensionErrorRecord>
Get all recorded errors.
Sourcepub fn clear_errors(&self)
pub fn clear_errors(&self)
Clear recorded errors.
Trait Implementations§
Source§impl Debug for ExtensionRegistry
impl Debug for ExtensionRegistry
Auto Trait Implementations§
impl Freeze for ExtensionRegistry
impl !RefUnwindSafe for ExtensionRegistry
impl Send for ExtensionRegistry
impl Sync for ExtensionRegistry
impl Unpin for ExtensionRegistry
impl UnsafeUnpin for ExtensionRegistry
impl !UnwindSafe for ExtensionRegistry
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
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,
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,
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>
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>
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