pub struct Detector { /* private fields */ }Expand description
Interfaces static analysis and wraps around parsed information for serialization.
Implementations§
Source§impl Detector
impl Detector
pub fn run(binpath: PathBuf) -> BinResult<Self>
Sourcepub fn output(&self, json: Option<String>, format: Format) -> BinResult<()>
pub fn output(&self, json: Option<String>, format: Format) -> BinResult<()>
Output the finalized report for the analysed executable.
--json <PATH> (back-compat) always wins: it writes the pretty JSON
report to PATH, or to stdout when PATH is -. Otherwise the
format selects the stdout representation: human tables (default),
JSON, or a native SARIF 2.1.0 document.
Sourcepub fn to_sarif(&self, tool_version: &str) -> BinResult<String>
pub fn to_sarif(&self, tool_version: &str) -> BinResult<String>
Build a native SARIF 2.1.0 JSON report from this detector’s findings.
The analysed binary’s absolute path (from the basic section) anchors
every result’s artifactLocation.
§Errors
Returns an error if SARIF construction or serialization fails.
Sourcepub fn write_reports(&self, output_dir: &Path) -> BinResult<()>
pub fn write_reports(&self, output_dir: &Path) -> BinResult<()>
Auto-generate the report.sarif + report.md pair under
output_dir, per the pipeline in skills/rust-sarif.md. The SARIF is
strict-validated and the Markdown structurally validated before each
file is written.
§Errors
Returns an error if output_dir is not a directory, validation fails,
or a report file cannot be written.