Skip to main content

cbh_model/
lib.rs

1#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
2#![cfg_attr(docsrs, doc(hidden))]
3#![expect(
4    clippy::exhaustive_enums,
5    clippy::exhaustive_structs,
6    reason = "this crate's `pub` items form an in-workspace handoff boundary to the \
7              cargo-bench-history analysis and shell crates, not a stable public API. \
8              Exhaustive construction and matching by those in-workspace consumers \
9              is intended"
10)]
11
12//! Implementation crate for [`cargo-bench-history`]; do not depend on this directly.
13//!
14//! The stored data model for a benchmark run: a run reduced to a set of benchmark
15//! results (each a stable identity plus its measured metrics), the run context that
16//! situates it in time and against a commit, and the comparability rules that
17//! partition runs into independently comparable series. Split out of
18//! `cargo-bench-history` so this I/O-free data model is cheap to
19//! mutation-test in isolation.
20//!
21//! Every type is re-exported flat from the crate root, so consumers write
22//! `cbh_model::DiscriminantSet` rather than reaching into a submodule.
23//!
24//! [`cargo-bench-history`]: https://github.com/folo-rs/folo
25
26mod aggregate;
27mod benchmark_id;
28mod bless;
29mod comparability;
30mod constants;
31mod context;
32mod identifiers;
33mod metric;
34mod run;
35
36pub use aggregate::{AggregateError, Combined, Selection, min_per_metric};
37pub use benchmark_id::{BenchmarkId, BenchmarkIdPrefix, EmptyBenchmarkIdPrefix};
38pub use bless::{BLESS_SCHEMA_VERSION, BlessingRecord};
39pub use comparability::{
40    DiscriminantSet, Engine, IntervalSupport, ObjectKind, StorageKey, parse_key, sanitize_segment,
41};
42pub use constants::{OBJECTS_SEGMENT, STORAGE_VERSION};
43pub use context::{
44    EnvironmentInfo, EnvironmentProvider, GitInfo, MachineInfo, RunContext, ToolchainInfo,
45    detect_environment,
46};
47pub use identifiers::{MachineKey, TargetTriple};
48pub use metric::{Metric, MetricKind};
49pub use run::{BenchmarkResult, MetricList, Run, SCHEMA_VERSION};