Skip to content

resolver

Structs

  • ResolvedConfig - Resolved config location plus the dir to re-base defaults against.

Enums

Functions

  • default_config_dir - The canonical directory to create config in when none is discovered.
  • resolve_config - Resolve the config file for subcommand. cli_override always 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

Enum

Where the resolved config came from.

Variants:

  • Flag - Explicit --config flag — overrides discovery (same sectioned schema).
  • ProjectLocal - Project-local .firma/firma.toml found by walking up from cwd
  • EnvDir - $FIRMA_CONFIG_DIR.
  • UserConfig - A platform user config dir.
  • SystemConfig - A system-wide config dir.
  • CwdFallback - CWD-relative firma.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

Struct

Resolved config location plus the dir to re-base defaults against.

Fields:

  • config_file: std::path::PathBuf - The firma.toml that 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>

Function

Resolve the config file for subcommand. cli_override always wins.

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>