pub struct SecurityScanner {
pub pattern_scan: bool,
pub ml_scan: bool,
pub blocking: bool,
pub block_threshold: f32,
pub max_scan_size: usize,
/* private fields */
}Expand description
Security scanner configuration
Fields§
§pattern_scan: boolEnable pattern-based scanning
ml_scan: boolEnable ML-based scanning
blocking: boolBlocking mode enabled
block_threshold: f32Blocking threshold (0.0 - 1.0)
max_scan_size: usizeMaximum content size to scan (bytes)
Implementations§
Source§impl SecurityScanner
impl SecurityScanner
Sourcepub fn with_model(self, model: HydraModel) -> Self
pub fn with_model(self, model: HydraModel) -> Self
Enable ML scanning with model
Sourcepub fn with_blocking(self, threshold: f32) -> Self
pub fn with_blocking(self, threshold: f32) -> Self
Enable blocking mode
Sourcepub fn scan(&self, content: &str) -> Result<ScanResult>
pub fn scan(&self, content: &str) -> Result<ScanResult>
Scan content for threats
Sourcepub fn quick_scan(&self, content: &str) -> ScanResult
pub fn quick_scan(&self, content: &str) -> ScanResult
Quick pattern-only scan (no ML)
Sourcepub fn validate_json(&self, content: &str) -> Result<()>
pub fn validate_json(&self, content: &str) -> Result<()>
Validate JSON structure
Sourcepub fn scan_and_validate(&self, content: &str) -> Result<ScanResult>
pub fn scan_and_validate(&self, content: &str) -> Result<ScanResult>
Scan and validate content (combined check)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SecurityScanner
impl !RefUnwindSafe for SecurityScanner
impl Send for SecurityScanner
impl Sync for SecurityScanner
impl Unpin for SecurityScanner
impl !UnwindSafe for SecurityScanner
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
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