pub struct ConfigSet { /* private fields */ }Expand description
A set of config files loaded together — the whole .declint.yaml, or
everything in a .declint/ directory.
Ids must be unique within one file, but different files may reuse
them: only the configs whose languages match a document ever apply
to it, so diagnostic codes stay unambiguous per document.
Implementations§
Source§impl ConfigSet
impl ConfigSet
Sourcepub fn single(config: Config) -> Self
pub fn single(config: Config) -> Self
A set holding exactly one config (no file path attached).
Sourcepub fn load(path: impl AsRef<Path>) -> Result<Self, ConfigError>
pub fn load(path: impl AsRef<Path>) -> Result<Self, ConfigError>
Loads path as a config site: a file is one config; a directory
is every *.yaml/*.yml inside it (in file-name order).
Sourcepub fn discover(start: &Path) -> Result<Self, ConfigError>
pub fn discover(start: &Path) -> Result<Self, ConfigError>
Finds and loads the config site for start, walking up through
parent directories. At each directory the search order is
CONFIG_FILE, CONFIG_DIR, LEGACY_CONFIG_FILE; the first
hit is loaded.
Sourcepub fn configs(&self) -> &[NamedConfig]
pub fn configs(&self) -> &[NamedConfig]
The loaded configs, in load order.
Sourcepub fn scope_table(&self) -> Vec<ScopeEntry>
pub fn scope_table(&self) -> Vec<ScopeEntry>
Every scope across every config, with its global position: entry.config
indexes ConfigSet::configs and entry.local indexes that
config’s scopes.