vyre-build-scan 0.1.0

Build-time filesystem scanner for flat trait-impl registries
Documentation
#![deny(missing_docs)]

//! 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.

mod config;
mod fatal;
mod flat;
mod paths;
mod rust_specs;

pub use config::{Registry, RustSpecRegistry};
pub use flat::{scan, scan_all};
pub use rust_specs::scan_rust_specs;