pub struct ConfigFile {
pub version: u32,
pub default_environment: String,
pub defaults: Defaults,
pub environments: BTreeMap<String, EnvironmentConfig>,
pub resources: ResourcesConfig,
pub naming: NamingConfig,
}Fields§
§version: u32Schema version. v1.0 binaries accept exactly 1. Bumping this is a
breaking event by design.
default_environment: String§defaults: Defaults§environments: BTreeMap<String, EnvironmentConfig>§resources: ResourcesConfig§naming: NamingConfigImplementations§
Source§impl ConfigFile
impl ConfigFile
Sourcepub fn load(path: impl AsRef<Path>) -> Result<Self>
pub fn load(path: impl AsRef<Path>) -> Result<Self>
Load and structurally validate a config file.
Sourcepub fn resolve(self, env_override: Option<&str>) -> Result<ResolvedConfig>
pub fn resolve(self, env_override: Option<&str>) -> Result<ResolvedConfig>
Resolve to a ResolvedConfig using the real process environment.
Sourcepub fn resolve_with(
self,
env_override: Option<&str>,
env_lookup: impl Fn(&str) -> Option<String>,
) -> Result<ResolvedConfig>
pub fn resolve_with( self, env_override: Option<&str>, env_lookup: impl Fn(&str) -> Option<String>, ) -> Result<ResolvedConfig>
Resolve using a caller-supplied env-var lookup closure. Used by
tests so they don’t have to touch process-global std::env.
Trait Implementations§
Source§impl Clone for ConfigFile
impl Clone for ConfigFile
Source§fn clone(&self) -> ConfigFile
fn clone(&self) -> ConfigFile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfigFile
impl Debug for ConfigFile
Source§impl<'de> Deserialize<'de> for ConfigFile
impl<'de> Deserialize<'de> for ConfigFile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ConfigFile
impl RefUnwindSafe for ConfigFile
impl Send for ConfigFile
impl Sync for ConfigFile
impl Unpin for ConfigFile
impl UnsafeUnpin for ConfigFile
impl UnwindSafe for ConfigFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more