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. Use
16//! [`install_shell_completion`] and [`uninstall_shell_completion`] for reusable
17//! shell completion lifecycle commands.
18
19mod cli;
20mod config;
21mod config_env;
22mod config_format;
23mod config_load;
24mod config_output;
25mod config_schema;
26mod config_templates;
27mod config_trace;
28mod config_util;
29mod error;
30mod path;
31mod template_tree;
32mod tree;
33
34pub use cli::{
35    ConfigCommand, handle_config_command, install_shell_completion, print_shell_completion,
36    uninstall_shell_completion, upsert_managed_block,
37};
38pub use config::{
39    ConfigFormat, ConfigResult, ConfigSchema, ConfigSchemaTarget, ConfigTemplateTarget,
40    ConfiqueEnvProvider, build_config_figment, config_schema_targets_for_path, load_config,
41    load_config_from_figment, load_config_with_figment, template_for_path,
42    template_targets_for_paths, template_targets_for_paths_with_schema, trace_config_sources,
43    write_config_schema, write_config_schemas, write_config_templates,
44    write_config_templates_with_schema,
45};
46pub use error::{BoxError, ConfigError, ConfigTreeError, Result};
47pub use path::{absolutize_lexical, normalize_lexical, resolve_include_path};
48pub use template_tree::{TemplateTarget, collect_template_targets, select_template_source};
49pub use tree::{
50    ConfigNode, ConfigSource, ConfigTree, ConfigTreeOptions, IncludeOrder, load_config_tree,
51};