ifc_model/traverse.rs
1//! Graph walks with cycle protection.
2//!
3//! Depth-first and breadth-first walks over the relationship graph, bounded
4//! against the cycles that occur in malformed files.
5//!
6//! Edges are supplied by the caller. This crate stores references without
7//! interpreting them, so it cannot know whether a given reference means
8//! containment, aggregation or voiding (ADR 0001). A domain crate
9//! decides which edges to follow and reuses the budgets and cycle reporting
10//! here.
11//!
12//! ## Internal split
13//!
14//! - `budget.rs`: shared traversal limits and reports.
15//! - `dfs.rs`: deterministic depth-first traversal.
16//! - `bfs.rs`: deterministic breadth-first traversal.
17//! - `cycle.rs`: cycle and path diagnostics.
18
19mod bfs;
20mod budget;
21mod cycle;
22mod dfs;
23
24pub use bfs::breadth_first;
25pub use budget::{Budget, Stop, Walk};
26pub use cycle::find_cycle;
27pub use dfs::depth_first;