Skip to main content

Crate rust_config_tree

Crate rust_config_tree 

Source
Expand description

Configuration-tree loading and CLI helpers for layered config files.

The high-level API loads confique schemas directly, while the lower-level tree traversal helpers remain available for custom loaders.

Use ConfigSchema with a confique::Config type when your schema owns an include field. Use load_config to load the root config, all recursive includes, .env values, and schema-declared environment values into the final schema. Use build_config_figment or load_config_with_figment when you need runtime source tracking. Use write_config_templates or ConfigCommand to generate example template files that mirror the same include tree. Use write_config_schemas to generate root and section JSON Schemas for editor completion and validation. Use install_shell_completion and uninstall_shell_completion for reusable shell completion lifecycle commands.

Structs§

ConfigNode
One loaded config source in a tree.
ConfigSchemaTarget
Generated JSON Schema content for one output path.
ConfigSource
Value and includes returned by a config source loader.
ConfigTemplateTarget
Generated template content for one output path.
ConfigTree
A loaded config tree in traversal order.
ConfigTreeOptions
Options for loading a recursive config tree.
ConfiqueEnvProvider
Figment provider that maps environment variables declared in confique schema metadata onto their exact field paths.
TemplateTarget
A source-to-output mapping for one generated config template.

Enums§

ConfigCommand
Built-in clap subcommands for config templates and shell completions.
ConfigError
Errors produced by high-level config loading and template generation.
ConfigFormat
File format used when loading config files or rendering templates.
ConfigTreeError
Errors produced while traversing a recursive config tree.
IncludeOrder
Controls the order in which sibling include paths are traversed.

Traits§

ConfigSchema
A confique schema that can expose recursive include paths and template section layout.

Functions§

absolutize_lexical
Converts a path to an absolute path and normalizes it lexically.
build_config_figment
Builds the Figment runtime source graph for a config tree.
collect_template_targets
Collects template targets by recursively following include paths.
config_schema_targets_for_path
Collects the root schema and section schemas for a config type.
handle_config_command
Handles a built-in config subcommand for a consumer CLI.
install_shell_completion
Generates shell completion files and updates shell startup files when needed.
load_config
Loads a complete confique schema from a root config path.
load_config_from_figment
Extracts and validates a config schema from a Figment source graph.
load_config_tree
Loads a config tree with default traversal options.
load_config_with_figment
Loads a config schema and returns the Figment graph used for runtime loading.
normalize_lexical
Normalizes a path by removing lexical . and .. components.
print_shell_completion
Writes shell completion output to stdout.
resolve_include_path
Resolves an include path relative to the file that declared it.
select_template_source
Chooses the source file used when generating templates.
template_for_path
Renders the default template for one path.
template_targets_for_paths
Collects all template targets that should be generated for a config tree.
template_targets_for_paths_with_schema
Collects template targets and binds TOML/YAML templates to JSON Schemas.
trace_config_sources
Emits Figment source metadata for every leaf field at TRACE level.
uninstall_shell_completion
Removes shell completion files and managed shell startup-file blocks.
upsert_managed_block
Inserts or replaces a managed shell configuration block in a startup file.
write_config_schema
Writes a Draft 7 JSON Schema for the root config type.
write_config_schemas
Writes the root schema and section schemas for a config type.
write_config_templates
Writes all generated config templates for a config tree.
write_config_templates_with_schema
Writes all generated config templates with editor schema bindings.

Type Aliases§

BoxError
Boxed error type used by custom loaders.
ConfigResult
Result type used by the high-level configuration API.
Result
Result type used by the lower-level tree API.