pub struct HookManager { /* private fields */ }Expand description
Central hook manager — dispatches events to all registered hooks
Implementations§
Source§impl HookManager
impl HookManager
pub fn new() -> Self
pub fn register_lifecycle(&mut self, hook: Arc<dyn LifecycleHook>)
pub fn register_pre_tool(&mut self, hook: Arc<dyn PreToolHook>)
pub fn register_post_tool(&mut self, hook: Arc<dyn PostToolHook>)
Sourcepub async fn emit(&self, event: &LifecycleEvent)
pub async fn emit(&self, event: &LifecycleEvent)
Fire event to all lifecycle hooks
Sourcepub async fn check_pre_tool(&self, name: &str, arguments: &str) -> HookDecision
pub async fn check_pre_tool(&self, name: &str, arguments: &str) -> HookDecision
Run pre-tool hooks — first Block wins
Sourcepub async fn notify_post_tool(
&self,
name: &str,
arguments: &str,
result: &ToolResult,
)
pub async fn notify_post_tool( &self, name: &str, arguments: &str, result: &ToolResult, )
Run post-tool hooks
Trait Implementations§
Source§impl Default for HookManager
impl Default for HookManager
Source§fn default() -> HookManager
fn default() -> HookManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for HookManager
impl !UnwindSafe for HookManager
impl Freeze for HookManager
impl Send for HookManager
impl Sync for HookManager
impl Unpin for HookManager
impl UnsafeUnpin for HookManager
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