pub struct DestructiveDetector { /* private fields */ }Expand description
Compiled detector reused across tool classifications.
Implementations§
Source§impl DestructiveDetector
impl DestructiveDetector
Sourcepub fn from_config(
destructive: &DestructiveConfig,
allow: &AllowDestructiveConfig,
) -> Result<Self, DestructiveError>
pub fn from_config( destructive: &DestructiveConfig, allow: &AllowDestructiveConfig, ) -> Result<Self, DestructiveError>
Compiles a detector from configuration. Returns an error if any pattern fails to parse.
Default keywords (delete, drop, …) stay active unless the
operator opts out via [destructive] replace_defaults = true.
Older configs that simply added patterns used to silently lose
the built-in protection — that footgun is gone.
Sourcepub fn classify(&self, tool: &Tool) -> ToolClassification
pub fn classify(&self, tool: &Tool) -> ToolClassification
Classifies a single tool.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DestructiveDetector
impl RefUnwindSafe for DestructiveDetector
impl Send for DestructiveDetector
impl Sync for DestructiveDetector
impl Unpin for DestructiveDetector
impl UnsafeUnpin for DestructiveDetector
impl UnwindSafe for DestructiveDetector
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