We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a9ce652 + b886c4e commit 66e3f7dCopy full SHA for 66e3f7d
src/config.rs
@@ -78,6 +78,28 @@ impl Config {
78
self.refresh()
79
}
80
81
+ /// Merge in a configuration property source.
82
+ pub fn with_merged<T>(mut self, source: T) -> Result<Self>
83
+ where
84
+ T: 'static,
85
+ T: Source + Send + Sync,
86
+ {
87
+ match self.kind {
88
+ ConfigKind::Mutable {
89
+ ref mut sources, ..
90
+ } => {
91
+ sources.push(Box::new(source));
92
+ }
93
+
94
+ ConfigKind::Frozen => {
95
+ return Err(ConfigError::Frozen);
96
97
98
99
+ self.refresh()?;
100
+ Ok(self)
101
102
103
/// Refresh the configuration cache with fresh
104
/// data from added sources.
105
///
0 commit comments