Skip to main content

rust_config_tree/
lib.rs

1#![warn(missing_docs)]
2
3//! Configuration-tree loading and CLI helpers for layered config files.
4//!
5//! The high-level API loads `confique` schemas directly, while the lower-level
6//! tree traversal helpers remain available for custom loaders.
7//!
8//! Use [`ConfigSchema`] with a `confique::Config` type when your schema owns an
9//! include field. Use [`load_config`] to load the root config, all recursive
10//! includes, `.env` values, and schema-declared environment values into the
11//! final schema. Use [`build_config_figment`] or [`load_config_with_figment`]
12//! when you need runtime source tracking. Use [`write_config_templates`] or
13//! [`ConfigCommand`] to generate example template files that mirror the same
14//! include tree. Use [`write_config_schemas`] to generate root and section JSON
15//! Schemas for editor completion and validation.
16
17mod cli;
18mod config;
19mod error;
20mod path;
21mod template;
22mod tree;
23
24pub use cli::{
25    ConfigCommand, handle_config_command, install_shell_completion, print_shell_completion,
26    upsert_managed_block,
27};
28pub use config::{
29    ConfigFormat, ConfigResult, ConfigSchema, ConfigSchemaTarget, ConfigTemplateTarget,
30    ConfiqueEnvProvider, build_config_figment, config_schema_targets_for_path, load_config,
31    load_config_from_figment, load_config_with_figment, template_for_path,
32    template_targets_for_paths, template_targets_for_paths_with_schema, trace_config_sources,
33    write_config_schema, write_config_schemas, write_config_templates,
34    write_config_templates_with_schema,
35};
36pub use error::{BoxError, ConfigError, ConfigTreeError, Result};
37pub use path::{absolutize_lexical, normalize_lexical, resolve_include_path};
38pub use template::{TemplateTarget, collect_template_targets, select_template_source};
39pub use tree::{
40    ConfigNode, ConfigSource, ConfigTree, ConfigTreeOptions, IncludeOrder, load_config_tree,
41};