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 !RefUnwindSafe for ExtensionRegistry
impl !UnwindSafe for ExtensionRegistry
impl Freeze for ExtensionRegistry
impl Send for ExtensionRegistry
impl Sync for ExtensionRegistry
impl Unpin for ExtensionRegistry
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + 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 moreimpl<T> MaybeSendSync for T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.