pub trait ConfigurationManager:
Value
+ Send
+ Sync {
// Required methods
fn get_config(&self) -> &dyn ConfigurationManagerConfig;
fn get_properties(&self) -> Vec<Box<dyn RawProperty>>;
fn get_property(
&self,
config: &dyn RawPropertyConfig,
) -> Box<dyn RawProperty>;
fn get_property_value(
&self,
config: &dyn RawPropertyConfig,
) -> Option<Box<dyn Value>>;
fn add_raw_change_listener(&self, listener: RawPropertyChangeListener);
fn clone_boxed(&self) -> Box<dyn ConfigurationManager>;
fn to_boxed(self) -> Box<dyn ConfigurationManager>;
}
Required Methods§
fn get_config(&self) -> &dyn ConfigurationManagerConfig
Sourcefn get_properties(&self) -> Vec<Box<dyn RawProperty>>
fn get_properties(&self) -> Vec<Box<dyn RawProperty>>
the properties created by get_property
Sourcefn get_property(&self, config: &dyn RawPropertyConfig) -> Box<dyn RawProperty>
fn get_property(&self, config: &dyn RawPropertyConfig) -> Box<dyn RawProperty>
get property value by get_property_value and return a property with the propertyConfig and value
once a property is created, it is kept by the manager and will be auto-update after some configuration source changed
same property config in, same property out, 1 key 1 property
Sourcefn get_property_value(
&self,
config: &dyn RawPropertyConfig,
) -> Option<Box<dyn Value>>
fn get_property_value( &self, config: &dyn RawPropertyConfig, ) -> Option<Box<dyn Value>>
get property value in each configuration source by source priority
if non-None value is got by a source ConfigurationSource::get_property_value if PropertyConfig::get_value_filter() is None, return the non-None value, if PropertyConfig::get_value_filter() is non-None, apply the filter to the non-None value, if the new value returned by the filter is non-None, return the new value. otherwise, go to the next lower priority source
after handling all sources, no non-None value got, return None
Sourcefn add_raw_change_listener(&self, listener: RawPropertyChangeListener)
fn add_raw_change_listener(&self, listener: RawPropertyChangeListener)
listeners to the property change, notified once property changed