pub trait ConfigSchema: Config + Sized {
// Required method
fn include_paths(layer: &<Self as Config>::Layer) -> Vec<PathBuf>;
// Provided method
fn template_path_for_section(section_path: &[&str]) -> Option<PathBuf> { ... }
}Expand description
A confique schema that can expose recursive include paths and template
section layout.
Implement this trait for the same type that derives confique::Config.
include_paths receives a partially loaded layer so the crate can discover
child config files before the final schema is merged.
Required Methods§
Provided Methods§
Sourcefn template_path_for_section(section_path: &[&str]) -> Option<PathBuf>
fn template_path_for_section(section_path: &[&str]) -> Option<PathBuf>
Overrides the generated template file path for a nested section.
By default, top-level sections are generated as config/<field>.yaml
and nested sections as children of their parent section file stem, e.g.
config/trading/risk.yaml.
§Arguments
section_path: Path of nested schema field names from the root schema to the section being rendered.
§Returns
Returns Some(path) to override the generated file path, or None to
use the default section path.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.