Trait CompiledRule

Source
pub trait CompiledRule: Send + Sync {
    // Required method
    fn get_string_matches(
        &self,
        content: &str,
        path: &Path<'_>,
        ctx: &mut StringMatchesCtx<'_>,
    ) -> Result<(), ScannerError>;

    // Provided methods
    fn init_per_scanner_data(&self, _per_scanner_data: &mut SharedData) { ... }
    fn init_per_string_data(
        &self,
        _labels: &Labels,
        _per_string_data: &mut SharedData,
    ) { ... }
    fn init_per_event_data(&self, _per_event_data: &mut SharedData) { ... }
    fn has_string_match(
        &self,
        content: &str,
        path: &Path<'_>,
        ctx: &mut StringMatchesCtx<'_>,
    ) -> Result<bool, ScannerError> { ... }
    fn should_exclude_multipass_v0(&self) -> bool { ... }
    fn on_excluded_match_multipass_v0(&self) { ... }
}

Required Methods§

Source

fn get_string_matches( &self, content: &str, path: &Path<'_>, ctx: &mut StringMatchesCtx<'_>, ) -> Result<(), ScannerError>

Provided Methods§

Source

fn init_per_scanner_data(&self, _per_scanner_data: &mut SharedData)

Source

fn init_per_string_data( &self, _labels: &Labels, _per_string_data: &mut SharedData, )

Source

fn init_per_event_data(&self, _per_event_data: &mut SharedData)

Source

fn has_string_match( &self, content: &str, path: &Path<'_>, ctx: &mut StringMatchesCtx<'_>, ) -> Result<bool, ScannerError>

Determines if this rule has a match, without determining the exact position, or finding multiple matches. The default implementation just calls get_string_matches, but this can be overridden with a more efficient implementation if applicable

Source

fn should_exclude_multipass_v0(&self) -> bool

Source

fn on_excluded_match_multipass_v0(&self)

Implementors§