pub struct PluginContext {
pub tools: Vec<Arc<dyn Tool>>,
pub hooks: HookManager,
}Expand description
Plugin context — passed to plugins during registration, allows tool registration
Fields§
§tools: Vec<Arc<dyn Tool>>Tools registered by plugins
hooks: HookManagerHook manager for lifecycle hooks
Implementations§
Source§impl PluginContext
impl PluginContext
pub fn new() -> Self
Sourcepub fn register_tool(&mut self, tool: Arc<dyn Tool>)
pub fn register_tool(&mut self, tool: Arc<dyn Tool>)
Register a tool that the agent can call
Sourcepub fn register_lifecycle_hook(&mut self, hook: Arc<dyn LifecycleHook>)
pub fn register_lifecycle_hook(&mut self, hook: Arc<dyn LifecycleHook>)
Register a lifecycle hook
Sourcepub fn register_pre_tool_hook(&mut self, hook: Arc<dyn PreToolHook>)
pub fn register_pre_tool_hook(&mut self, hook: Arc<dyn PreToolHook>)
Register a pre-tool hook
Sourcepub fn register_post_tool_hook(&mut self, hook: Arc<dyn PostToolHook>)
pub fn register_post_tool_hook(&mut self, hook: Arc<dyn PostToolHook>)
Register a post-tool hook
Trait Implementations§
Source§impl Default for PluginContext
impl Default for PluginContext
Source§fn default() -> PluginContext
fn default() -> PluginContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for PluginContext
impl !UnwindSafe for PluginContext
impl Freeze for PluginContext
impl Send for PluginContext
impl Sync for PluginContext
impl Unpin for PluginContext
impl UnsafeUnpin for PluginContext
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§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