pub struct ConfigUpdates {
pub updates: BTreeMap<String, ConfigVal>,
}
Expand description
Fields§
§updates: BTreeMap<String, ConfigVal>
Implementations§
Source§impl ConfigUpdates
impl ConfigUpdates
Sourcepub fn add<T, U>(&mut self, config: &Config<T>, val: U)
pub fn add<T, U>(&mut self, config: &Config<T>, val: U)
Adds an update for the given config and value.
If a value of the same config has previously been added to these updates, replaces it.
Sourcepub fn add_dynamic(&mut self, name: &str, val: ConfigVal)
pub fn add_dynamic(&mut self, name: &str, val: ConfigVal)
Adds an update for the given configuration name and value.
It is the callers responsibility to ensure the value is of the appropriate type for the configuration.
If a value of the same config has previously been added to these updates, replaces it.
Sourcepub fn extend(&mut self, other: Self)
pub fn extend(&mut self, other: Self)
Adds the entries in other
to self
, with other
taking precedence.
Sourcepub fn apply(&self, set: &ConfigSet)
pub fn apply(&self, set: &ConfigSet)
Applies these config updates to the given ConfigSet.
This doesn’t need to be the same set that the value updates were added from. In fact, the primary use of this is propagating config updates across processes.
The value updates for any configs unknown by the given set are skipped. Ditto for config type mismatches. However, this is unexpected usage at present and so is logged to Sentry.
Trait Implementations§
Source§impl Clone for ConfigUpdates
impl Clone for ConfigUpdates
Source§fn clone(&self) -> ConfigUpdates
fn clone(&self) -> ConfigUpdates
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more