Skip to main content

Detector

Struct Detector 

Source
pub struct Detector { /* private fields */ }
Expand description

Interfaces static analysis and wraps around parsed information for serialization.

Implementations§

Source§

impl Detector

Source

pub fn run(binpath: PathBuf) -> BinResult<Self>

Source

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.

Source

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.

Source

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.

Source

pub fn table(name: &str, mapping: &GenericMap)

Trait Implementations§

Source§

impl Serialize for Detector

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.