Skip to main content

FileAnalyzer

Trait FileAnalyzer 

Source
pub trait FileAnalyzer {
    // Required methods
    fn analyze(
        &self,
        file_path: &Path,
        content: &str,
    ) -> GuardianResult<Vec<Violation>>;
    fn handles_file(&self, file_path: &Path) -> bool;
}
Expand description

Trait for custom file analyzers

Required Methods§

Source

fn analyze( &self, file_path: &Path, content: &str, ) -> GuardianResult<Vec<Violation>>

Analyze a file and return violations

Source

fn handles_file(&self, file_path: &Path) -> bool

Check if this analyzer handles the given file type

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§