pub struct DataflowTracer {
pub max_hops: u32,
}Expand description
Traces data flow for a variable up to max_hops hops backward.
Uses heuristic pattern matching (assignment operators, let bindings).
For a full implementation, integrate with LSP type inference.
Fields§
§max_hops: u32Maximum number of backward hops to trace.
Implementations§
Source§impl DataflowTracer
impl DataflowTracer
Sourcepub fn trace(
&self,
source: &str,
variable: &str,
file: &str,
) -> Vec<DataflowHop>
pub fn trace( &self, source: &str, variable: &str, file: &str, ) -> Vec<DataflowHop>
Trace dataflow for a variable in the given source text.
Returns origins found within DataflowTracer::max_hops backward hops.
§Examples
use synwire_agent::dataflow::DataflowTracer;
let tracer = DataflowTracer::new(5);
let source = "let x = 5;\nlet y = x + 1;\nx = compute();\n";
let hops = tracer.trace(source, "x", "test.rs");
assert!(!hops.is_empty());Auto Trait Implementations§
impl Freeze for DataflowTracer
impl RefUnwindSafe for DataflowTracer
impl Send for DataflowTracer
impl Sync for DataflowTracer
impl Unpin for DataflowTracer
impl UnsafeUnpin for DataflowTracer
impl UnwindSafe for DataflowTracer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more