pub struct ImpactConfig {
pub max_depth: usize,
pub language: Option<String>,
pub include_patterns: Vec<String>,
pub exclude_patterns: Vec<String>,
pub exclude_tests: bool,
pub include_call_sites: bool,
pub deduplicate_paths: bool,
}Expand description
Configuration for impact analysis.
Fields§
§max_depth: usizeMaximum depth to traverse (0 = NO traversal, direct callers only).
This controls how many levels of the call hierarchy are explored:
max_depth = 0: NO exploration - returns only direct callers (distance 1)max_depth = 1: Explore direct callers to find distance 2 callersmax_depth = 2: Explore up to distance 2, finding callers up to distance 3max_depth = N: Explore up to distance N, potentially finding callers at distance N+1
This matches Python semantics where depth <= 0 causes immediate truncation.
Note: The depth controls exploration, not the maximum distance in results.
language: Option<String>Filter by language (e.g., “python”, “rust”).
include_patterns: Vec<String>Glob patterns to include (e.g., “src/**/*.rs”).
exclude_patterns: Vec<String>Glob patterns to exclude (e.g., “/test/”).
exclude_tests: boolWhether to exclude test files from results.
include_call_sites: boolWhether to include call site information.
deduplicate_paths: boolIf true, each node appears only once (first path wins, BFS behavior). If false, all paths are explored with per-branch visited sets (DFS, Python semantics). When false, the minimum distance across all paths is recorded for each node.
For diamond-shaped call graphs like:
A
/ \
B C
\ /
D (target)deduplicate_paths = true: A appears once at distance 2 (via first explored path)deduplicate_paths = false: All paths explored, A at minimum distance 2 with aggregated call sites
Implementations§
Source§impl ImpactConfig
impl ImpactConfig
Sourcepub fn with_depth(self, depth: usize) -> Self
pub fn with_depth(self, depth: usize) -> Self
Set maximum traversal depth.
The depth controls how many levels of callers are explored. With depth N, the algorithm explores callers up to distance N from the target, which means callers at distance N+1 may be discovered but not explored further.
Sourcepub fn with_language(self, lang: &str) -> Self
pub fn with_language(self, lang: &str) -> Self
Filter results by language.
Sourcepub fn with_includes(self, patterns: &[&str]) -> Self
pub fn with_includes(self, patterns: &[&str]) -> Self
Add file patterns to include.
Sourcepub fn with_excludes(self, patterns: &[&str]) -> Self
pub fn with_excludes(self, patterns: &[&str]) -> Self
Add file patterns to exclude.
Sourcepub fn exclude_tests(self) -> Self
pub fn exclude_tests(self) -> Self
Exclude test files from results.
Sourcepub fn with_call_sites(self) -> Self
pub fn with_call_sites(self) -> Self
Include call site line numbers in results.
Sourcepub fn with_deduplicate_paths(self, deduplicate: bool) -> Self
pub fn with_deduplicate_paths(self, deduplicate: bool) -> Self
Enable or disable path deduplication.
When enabled (default), each node appears only once using BFS traversal.
When disabled, all paths are explored using DFS with per-branch visited sets,
matching Python’s _build_caller_tree semantics where visited.copy() is used.
Use false for complete path exploration in diamond-shaped call graphs.
Sourcepub fn explore_all_paths(self) -> Self
pub fn explore_all_paths(self) -> Self
Disable path deduplication to explore all paths (Python-compatible mode).
This is a convenience method equivalent to with_deduplicate_paths(false).
Trait Implementations§
Source§impl Clone for ImpactConfig
impl Clone for ImpactConfig
Source§fn clone(&self) -> ImpactConfig
fn clone(&self) -> ImpactConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ImpactConfig
impl Debug for ImpactConfig
Auto Trait Implementations§
impl Freeze for ImpactConfig
impl RefUnwindSafe for ImpactConfig
impl Send for ImpactConfig
impl Sync for ImpactConfig
impl Unpin for ImpactConfig
impl UnwindSafe for ImpactConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request