zng_ext_config

Trait Config

source
pub trait Config: AnyConfig {
    // Required method
    fn get<T: ConfigValue>(
        &mut self,
        key: impl Into<ConfigKey>,
        default: T,
        insert: bool,
    ) -> BoxedVar<T>;
}
Expand description

Represents one or more config sources.

Required Methods§

source

fn get<T: ConfigValue>( &mut self, key: impl Into<ConfigKey>, default: T, insert: bool, ) -> BoxedVar<T>

Gets a variable that is bound to the config key.

The same variable is returned for multiple requests of the same key. If the loaded config is not read-only the returned variable can be set to update the config source.

The default value is used if the key is not found in the config, the default value is only inserted in the config if insert, otherwise the key is inserted or replaced only when the returned variable changes.

Object Safety§

This trait is not object safe.

Implementors§