Skip to main content

Module traverse

Module traverse 

Source
Expand description

Graph walks with cycle protection.

Depth-first and breadth-first walks over the relationship graph, bounded against the cycles that occur in malformed files.

Edges are supplied by the caller. This crate stores references without interpreting them, so it cannot know whether a given reference means containment, aggregation or voiding (ADR 0001). A domain crate decides which edges to follow and reuses the budgets and cycle reporting here.

§Internal split

  • budget.rs: shared traversal limits and reports.
  • dfs.rs: deterministic depth-first traversal.
  • bfs.rs: deterministic breadth-first traversal.
  • cycle.rs: cycle and path diagnostics.

Structs§

Budget
Limits applied to a single walk.
Walk
The outcome of a bounded walk.

Enums§

Stop
Why a walk stopped.

Functions§

breadth_first
Walk breadth-first from start, following successors.
depth_first
Walk depth-first from start, following successors.
find_cycle
Find one cycle reachable from start, if any.