sim_config/source.rs
1//! Configuration source descriptors.
2
3use std::path::PathBuf;
4
5use sim_kernel::Symbol;
6
7/// Source layer that contributed configuration data.
8#[derive(Clone, Debug, PartialEq, Eq)]
9pub enum ConfigSource {
10 /// Built-in defaults supplied by the named library.
11 BuiltIn {
12 /// Library whose defaults produced this layer.
13 lib: Symbol,
14 },
15 /// Defaults produced by a modeled or real probe.
16 Probe {
17 /// Probe implementation id.
18 probe: Symbol,
19 /// Probe mode used to produce the layer.
20 mode: ProbeMode,
21 },
22 /// Per-library file from the central home config root.
23 HomeFile {
24 /// File path that produced this layer.
25 path: PathBuf,
26 },
27 /// Per-library file from the working config root.
28 WorkFile {
29 /// File path that produced this layer.
30 path: PathBuf,
31 },
32 /// Single `sim.toml` file containing multiple library tables.
33 SingleFile {
34 /// File path that produced this layer.
35 path: PathBuf,
36 },
37 /// Opaque site-backed config producer.
38 Site {
39 /// Site id.
40 site: Symbol,
41 },
42 /// Explicit process-level override.
43 Explicit {
44 /// Human-readable override label.
45 label: String,
46 },
47}
48
49/// Probe mode for config defaults.
50#[derive(Clone, Copy, Debug, PartialEq, Eq)]
51pub enum ProbeMode {
52 /// Deterministic, modeled inventory; performs no real I/O.
53 Modeled,
54 /// Capability-gated real inventory.
55 Real,
56}