sdivi_graph/lib.rs
1//! Dependency graph construction for sdivi-rust.
2//!
3//! Builds a `petgraph`-backed directed dependency graph. Two entry points:
4//! - [`build_dependency_graph`] (feature `pipeline-records`, ON by default) — takes
5//! [`sdivi_parsing::feature_record::FeatureRecord`] slices from the parsing stage.
6//! - [`build_dependency_graph_from_edges`] (always available) — takes raw node paths
7//! and `(from, to)` edge pairs for WASM / pure-compute consumers.
8//!
9//! # Quick Start
10//!
11//! ```rust
12//! use sdivi_graph::dependency_graph::build_dependency_graph_from_edges;
13//! use sdivi_graph::metrics::compute_metrics;
14//!
15//! let dg = build_dependency_graph_from_edges(&[], &[]);
16//! let m = compute_metrics(&dg);
17//! assert_eq!(m.node_count, 0);
18//! ```
19
20pub mod dependency_graph;
21pub mod metrics;
22
23pub use dependency_graph::{build_dependency_graph_from_edges, DependencyGraph, GraphError};
24pub use metrics::{compute_metrics, GraphMetrics};
25
26#[cfg(feature = "pipeline-records")]
27pub use dependency_graph::build_dependency_graph;