pub struct CodeQualityHook { /* private fields */ }Expand description
Code quality verification hook
Implementations§
Source§impl CodeQualityHook
impl CodeQualityHook
Sourcepub fn new(strategy: VerificationStrategy) -> Self
pub fn new(strategy: VerificationStrategy) -> Self
Create with strategy
Sourcepub fn from_strategy_str(strategy: &str) -> Self
pub fn from_strategy_str(strategy: &str) -> Self
Create with strategy string
Sourcepub fn with_project_root(self, root: Arc<PathBuf>) -> Self
pub fn with_project_root(self, root: Arc<PathBuf>) -> Self
Set project root
Sourcepub fn set_enabled(self, enabled: bool) -> Self
pub fn set_enabled(self, enabled: bool) -> Self
Set enabled status
Sourcepub fn strategy(&self) -> VerificationStrategy
pub fn strategy(&self) -> VerificationStrategy
Get verification strategy
Trait Implementations§
Source§impl Default for CodeQualityHook
impl Default for CodeQualityHook
Source§impl ToolHook for CodeQualityHook
impl ToolHook for CodeQualityHook
Source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Whether this hook is enabled
Source§fn applies_to(&self) -> Vec<&str>
fn applies_to(&self) -> Vec<&str>
Tools this hook applies to (empty = all tools)
Source§fn pre_execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
params: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<HookResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn pre_execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
params: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<HookResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Pre-execute hook (before tool execution)
Returns HookResult to control execution flow
Source§fn post_execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_tool_name: &'life1 str,
_params: &'life2 Value,
result: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn post_execute<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_tool_name: &'life1 str,
_params: &'life2 Value,
result: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Post-execute hook (after tool execution)
Can modify the result before returning to AI
Source§fn applies_to_tool(&self, tool_name: &str) -> bool
fn applies_to_tool(&self, tool_name: &str) -> bool
Check if hook applies to a specific tool
Auto Trait Implementations§
impl Freeze for CodeQualityHook
impl RefUnwindSafe for CodeQualityHook
impl Send for CodeQualityHook
impl Sync for CodeQualityHook
impl Unpin for CodeQualityHook
impl UnsafeUnpin for CodeQualityHook
impl UnwindSafe for CodeQualityHook
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