pub struct TrashGuardLogic { /* private fields */ }Expand description
Pure guard logic — no I/O. Callable from Hook impl AND tests.
Implementations§
Source§impl TrashGuardLogic
impl TrashGuardLogic
pub fn new(config: DeletionConfig) -> Self
Sourcepub fn check_batch_size(&self, count: usize) -> Result<(), GuardError>
pub fn check_batch_size(&self, count: usize) -> Result<(), GuardError>
Check batch size is within limits.
Sourcepub fn check_path_scope(&self, path: &Path) -> Result<(), GuardError>
pub fn check_path_scope(&self, path: &Path) -> Result<(), GuardError>
Check a path is within allowed scope (trusted_paths or not).
Sourcepub fn detect(
&self,
tool_name: &str,
tool_input: &Value,
) -> Vec<DestructivePattern>
pub fn detect( &self, tool_name: &str, tool_input: &Value, ) -> Vec<DestructivePattern>
Detect all destructive patterns in a tool call.
pub fn config(&self) -> &DeletionConfig
Auto Trait Implementations§
impl Freeze for TrashGuardLogic
impl RefUnwindSafe for TrashGuardLogic
impl Send for TrashGuardLogic
impl Sync for TrashGuardLogic
impl Unpin for TrashGuardLogic
impl UnsafeUnpin for TrashGuardLogic
impl UnwindSafe for TrashGuardLogic
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