pub trait SourceCallback {
// Required method
fn is_source(&self, node: i64, entity: &GraphEntity) -> bool;
}Expand description
Callback trait for detecting taint sources.
Implement this trait to define custom source detection logic. The callback receives a node ID and its entity data, returning true if the node is a taint source.
§Example
ⓘ
use sqlitegraph::algo::{SourceCallback, TaintResult};
use sqlitegraph::graph::types::GraphEntity;
struct HttpParamDetector;
impl SourceCallback for HttpParamDetector {
fn is_source(&self, node: i64, entity: &GraphEntity) -> bool {
// Detect HTTP parameter nodes
entity.kind == "http_param" ||
entity.data["taint"].as_str() == Some("untrusted")
}
}