pub trait ConfigSection:
DeserializeOwned
+ Default
+ Send
+ Sync
+ 'static {
// Required method
fn section_name() -> &'static str;
// Provided methods
fn section_key(&self) -> &'static str { ... }
fn load(loader: &DefaultLoader) -> Result<Self, ConfigError> { ... }
}Expand description
Marks a typed struct as the owner of a named TOML section.
Implement this on any serde::Deserialize + Default config struct. The
runtime calls ConfigSection::load once at startup — callers never
write the loader call manually.
Required Methods§
Sourcefn section_name() -> &'static str
fn section_name() -> &'static str
The top-level TOML key for this section (e.g. "mtls", "authz").
Provided Methods§
Sourcefn section_key(&self) -> &'static str
fn section_key(&self) -> &'static str
The top-level TOML key for this section from a runtime value.
Sourcefn load(loader: &DefaultLoader) -> Result<Self, ConfigError>
fn load(loader: &DefaultLoader) -> Result<Self, ConfigError>
Load this section from loader, returning Self::default() when the
key is absent. Override only when custom merge logic is required.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".