1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! Build-time filesystem scanner. Emits a typed registry from a flat directory
//! of `.rs` files, so adding a new responsibility is one file drop with zero
//! modifications to any other file.
//!
//! # build.rs example
//!
//! ```ignore
//! vyre_build_scan::scan(&vyre_build_scan::Registry {
//! scan_dir: "src/enforce/gates",
//! const_name: "ALL_GATES",
//! element_type: "&'static dyn crate::enforce::EnforceGate",
//! item_const_name: "REGISTERED",
//! output_file: "gates_registry.rs",
//! module_prefix: "crate::enforce::gates",
//! });
//! ```
//!
//! # Model
//!
//! Every responsibility directory follows this shape:
//!
//! ```text
//! src/gates/
//! mod.rs - declares: `automod::dir!(pub "src/gates");`
//! plus: `include!(concat!(env!("OUT_DIR"), "/gates_registry.rs"));`
//! atomics.rs - exposes: `pub const GATE: Atomics = Atomics;`
//! barrier.rs - exposes: `pub const GATE: Barrier = Barrier;`
//! oob.rs - ...
//! ```
//!
//! Build-time, [`scan`] walks `src/gates/`, reads every `.rs` file other than
//! `mod.rs` and filenames starting with `_`, and writes
//! `$OUT_DIR/gates_registry.rs` containing a flat slice referencing the
//! constants.
//!
//! The contributor adds `src/gates/my_gate.rs` with one
//! `pub const GATE: MyGate = MyGate;` declaration. Nothing else in the tree
//! changes. `cargo build` wires it in.
//!
//! This is the collision-free single-responsibility enforcement mechanism: no
//! central list of registrations, no manual `pub mod` edits, no `inventory`
//! linker-section magic. Pure filesystem scanning, build-time codegen, and
//! static dispatch.
pub use ;
pub use ;
pub use scan_rust_specs;