pub struct SectionConfig {
pub application: String,
pub profile: String,
pub files: Vec<String>,
pub env_prefix: Option<String>,
pub whole_document: bool,
}Expand description
One served application-and-profile pair.
The section key inside the files is the application name: a document
served as billing is the [billing] table of the configured files.
That is one fact rather than two, and it keeps a URL and a file readable
against each other.
Fields§
§application: StringThe application, which is both the first path segment and the section key inside the files.
profile: StringThe profile, which is the second path segment.
A profile here is a different set of files, chosen by the
operator, rather than the library’s profile_env — that one is a
process-wide environment variable, and a server serving two profiles
cannot have two of those at once.
files: Vec<String>The files to merge, in order; later files win.
env_prefix: Option<String>An environment-variable prefix layered above the files, as in
APP_ reading APP_BILLING_*.
whole_document: boolWhether these files carry a section header at all.
false — the default — reads the application as a top-level key
inside each file, so one file can hold several applications.
true says each file is this section: {"host": …, "port": …}
with nothing above it. A config server is routinely pointed at
files somebody else’s tool writes, and those files have no reason
to carry a header this server invented.
Trait Implementations§
Source§impl Clone for SectionConfig
impl Clone for SectionConfig
Source§fn clone(&self) -> SectionConfig
fn clone(&self) -> SectionConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more