pub struct TakConfigLayer { /* private fields */ }Expand description
tak.toml as a settings layer.
Not usage’s FileLayer: tak.toml is tak’s general config file, so most of
what it holds — [bench] above all — is not a setting, and scanning the file
would warn about every one of those keys. This reads the other way around:
it iterates the registry’s source("config", ...) bindings and looks each
dotted key up in the parsed TOML, so a key nothing declares is simply not
looked at.
A missing tak.toml is fine. A syntax-broken one — or a declared key
holding the wrong type — is an error rather than a warning: the file may
carry [env] settings that change what gets scrubbed from a subject’s
environment, and quietly applying a weaker filter than the project asked
for is not a good failure.
Implementations§
Source§impl TakConfigLayer
impl TakConfigLayer
Sourcepub fn find(start: &Path) -> Result<Self>
pub fn find(start: &Path) -> Result<Self>
Find and parse tak.toml, searching upward from start.
Walking up means settings resolve the same from a subdirectory as from
the repository root, exactly like Config::find.
Sourcepub fn at(path: &Path) -> Result<Self>
pub fn at(path: &Path) -> Result<Self>
Parse the settings in a given file, for tak run --config. Unlike
find, a missing file is an error: it was asked for by name.
Trait Implementations§
Source§impl Layer for TakConfigLayer
impl Layer for TakConfigLayer
Source§fn source(&self) -> SourceKind
fn source(&self) -> SourceKind
explain.