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
56
57
58
59
60
61
62
63
64
65
//! Public configuration types consumed by `build.rs`.
/// Description of one flat responsibility registry to emit from `build.rs`.
///
/// The scanner resolves [`Registry::scan_dir`] under `CARGO_MANIFEST_DIR` and
/// resolves [`Registry::output_file`] under `OUT_DIR`. `output_file` must be a
/// bare file name, which prevents consumer build scripts from writing generated
/// registry files into `src/`.
///
/// # 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",
/// });
/// ```
/// Description of one Rust-source `OpSpec` registry to emit from `build.rs`.
///
/// Use this when operation implementations expose `pub const SPEC: OpSpec` or
/// an associated `impl Type { pub const SPEC: OpSpec = ...; }` and the crate
/// wants a generated `&[&OpSpec]` in `OUT_DIR`.
///
/// # build.rs example
///
/// ```ignore
/// vyre_build_scan::scan_rust_specs(&vyre_build_scan::RustSpecRegistry {
/// scan_dirs: &["src/ops"],
/// const_name: "GENERATED_REGISTRY",
/// output_file: "ops_registry.rs",
/// });
/// ```