resolver
Module: resolver
Section titled “Module: resolver”Contents
Section titled “Contents”Structs
ResolvedConfig- Resolved config location plus the dir to re-base defaults against.
Enums
ConfigResolveError- Resolution failure. Fail-closed; lists every directory searched.ConfigSource- Where the resolved config came from.
Functions
default_config_dir- The canonical directory to create config in when none is discovered.resolve_config- Resolve the config file forsubcommand.cli_overridealways wins.
firma_config::resolver::ConfigResolveError
Section titled “firma_config::resolver::ConfigResolveError”Enum
Resolution failure. Fail-closed; lists every directory searched.
Variants:
NotFound{ subcommand: String, searched: Vec<std::path::PathBuf> }
Traits: Error
Trait Implementations:
- Display
fn fmt(self: &Self, __formatter: & mut ::core::fmt::Formatter) -> ::core::fmt::Result
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
firma_config::resolver::ConfigSource
Section titled “firma_config::resolver::ConfigSource”Enum
Where the resolved config came from.
Variants:
Flag- Explicit--configflag — overrides discovery (same sectioned schema).ProjectLocal- Project-local.firma/firma.tomlfound by walking up from cwdEnvDir-$FIRMA_CONFIG_DIR.UserConfig- A platform user config dir.SystemConfig- A system-wide config dir.CwdFallback- CWD-relativefirma.toml(back-compat last fallback).
Traits: Copy, Eq
Trait Implementations:
- PartialEq
fn eq(self: &Self, other: &ConfigSource) -> bool
- Clone
fn clone(self: &Self) -> ConfigSource
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
firma_config::resolver::ResolvedConfig
Section titled “firma_config::resolver::ResolvedConfig”Struct
Resolved config location plus the dir to re-base defaults against.
Fields:
config_file: std::path::PathBuf- Thefirma.tomlthat won.config_dir: std::path::PathBuf- Its parent — base for unset resource paths.source: ConfigSource- Provenance, for startup logs and schema selection.
Traits: Eq
Trait Implementations:
- Debug
fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
- PartialEq
fn eq(self: &Self, other: &ResolvedConfig) -> bool
- Clone
fn clone(self: &Self) -> ResolvedConfig
firma_config::resolver::default_config_dir
Section titled “firma_config::resolver::default_config_dir”Function
The canonical directory to create config in when none is discovered.
Resolution order: $FIRMA_CONFIG_DIR → $XDG_CONFIG_HOME/firma →
home-convention dir (Unix ~/.config/firma, Windows
%USERPROFILE%\.firma) → platform config dir + /firma. None only
if no home/config dir is resolvable on this platform.
fn default_config_dir(provider: &dyn DirProvider) -> Option<std::path::PathBuf>firma_config::resolver::resolve_config
Section titled “firma_config::resolver::resolve_config”Function
Resolve the config file for subcommand. cli_override always wins.
Errors
Section titled “Errors”Returns [ConfigResolveError::NotFound] (listing every searched path)
when no file exists in any tier.
fn resolve_config(subcommand: &str, cli_override: Option<&std::path::Path>, provider: &dyn DirProvider) -> Result<ResolvedConfig, ConfigResolveError>