pub struct HookSubscriptions { /* private fields */ }Expand description
Declarative set of hook points and tool filters active for a handler or bridge.
The runtime checks subscriptions before building hook contexts or emitting host-bridge invocations, so unregistered hooks add zero runtime traffic.
Implementations§
Source§impl HookSubscriptions
impl HookSubscriptions
Sourcepub const fn with_before_model_step(self, enabled: bool) -> Self
pub const fn with_before_model_step(self, enabled: bool) -> Self
Enables or disables before_model_step hook dispatch.
Sourcepub const fn with_after_model_step(self, enabled: bool) -> Self
pub const fn with_after_model_step(self, enabled: bool) -> Self
Enables or disables after_model_step hook dispatch.
Sourcepub fn with_before_tool_call(self, filter: ToolHookFilter) -> Self
pub fn with_before_tool_call(self, filter: ToolHookFilter) -> Self
Sets the tool filter for before_tool_call hook dispatch.
Sourcepub fn with_after_tool_call(self, filter: ToolHookFilter) -> Self
pub fn with_after_tool_call(self, filter: ToolHookFilter) -> Self
Sets the tool filter for after_tool_call hook dispatch.
Sourcepub const fn matches_before_model_step(&self) -> bool
pub const fn matches_before_model_step(&self) -> bool
Returns whether before_model_step is subscribed.
Sourcepub const fn matches_after_model_step(&self) -> bool
pub const fn matches_after_model_step(&self) -> bool
Returns whether after_model_step is subscribed.
Sourcepub fn matches_before_tool_call(&self, tool_name: &ToolName) -> bool
pub fn matches_before_tool_call(&self, tool_name: &ToolName) -> bool
Returns whether before_tool_call is subscribed for tool_name.
Sourcepub fn matches_after_tool_call(&self, tool_name: &ToolName) -> bool
pub fn matches_after_tool_call(&self, tool_name: &ToolName) -> bool
Returns whether after_tool_call is subscribed for tool_name.
Sourcepub fn merge_with(&mut self, other: &Self)
pub fn merge_with(&mut self, other: &Self)
Merges other into self for composite RuntimeHookHandler implementations.
Trait Implementations§
Source§impl Clone for HookSubscriptions
impl Clone for HookSubscriptions
Source§impl Debug for HookSubscriptions
impl Debug for HookSubscriptions
Source§impl Default for HookSubscriptions
impl Default for HookSubscriptions
impl Eq for HookSubscriptions
Source§impl PartialEq for HookSubscriptions
impl PartialEq for HookSubscriptions
impl StructuralPartialEq for HookSubscriptions
Auto Trait Implementations§
impl Forget for HookSubscriptions
impl Freeze for HookSubscriptionswhere
*const LeafNode<ToolName, SetValZST> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(ToolName, SetValZST)>>: Freeze,
impl Move for HookSubscriptions
impl RefUnwindSafe for HookSubscriptions
impl Send for HookSubscriptions
impl Sync for HookSubscriptions
impl Unpin for HookSubscriptions
impl UnsafeUnpin for HookSubscriptionswhere
*const LeafNode<ToolName, SetValZST> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(ToolName, SetValZST)>>: UnsafeUnpin,
impl UnwindSafe for HookSubscriptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.