critpath_core/lib.rs
1//! Schedule simulation and counterfactual analysis over a weighted build DAG.
2//!
3//! This crate knows nothing about Cargo, `rustc`, files, or JSON. It takes a graph of weighted
4//! compilation units joined by dependency edges, and answers two kinds of question about it:
5//! how long the build must take, and what a change to the graph would do to that number.
6//!
7//! Using it for a build system other than Cargo means writing an adapter that produces a
8//! [`BuildGraph`]; nothing in here has to change.
9//!
10//! The model, its invariants, and its known systematic errors are documented in [`docs/model.md`](https://github.com/eventvoid/cargo-critpath/blob/main/docs/model.md)
11//! in the repository.
12
13#![forbid(unsafe_code)]
14
15mod analysis;
16mod error;
17mod graph;
18mod millis;
19mod schedule;
20mod transform;
21
22pub use analysis::{analyze, Analysis};
23pub use error::GraphError;
24pub use graph::{BuildGraph, Dep, EdgeKind, GraphBuilder, Unit, UnitId, UnitKind, MAX_UNITS};
25pub use millis::Millis;
26pub use schedule::{area_bound, lower_bound, simulate, Policy, Schedule};
27pub use transform::{apply, roots, Applied, Mapped, SplitDependents, Transform, TransformError};