use std::collections::BTreeMap;
use std::path::Path;
use std::path::PathBuf;
#[derive(Debug, Clone)]
pub enum ConfigLayer {
File(PathBuf),
EnvPrefix(String),
Overrides(BTreeMap<String, toml::Value>),
}
impl ConfigLayer {
#[must_use]
pub fn file(path: impl AsRef<Path>) -> Self {
Self::File(path.as_ref().to_path_buf())
}
#[must_use]
pub fn env_prefix(prefix: impl Into<String>) -> Self {
Self::EnvPrefix(prefix.into())
}
#[must_use]
pub fn overrides(overrides: BTreeMap<String, toml::Value>) -> Self {
Self::Overrides(overrides)
}
}