Skip to main content

ConfigurationManager

Trait ConfigurationManager 

Source
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§

Source

fn get_config(&self) -> &dyn ConfigurationManagerConfig

Source

fn get_properties(&self) -> Vec<Box<dyn RawProperty>>

the properties created by get_property

Source

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

Source

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

Source

fn add_raw_change_listener(&self, listener: RawPropertyChangeListener)

listeners to the property change, notified once property changed

Source

fn clone_boxed(&self) -> Box<dyn ConfigurationManager>

Source

fn to_boxed(self) -> Box<dyn ConfigurationManager>

Trait Implementations§

Source§

impl Clone for Box<dyn ConfigurationManager>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl PartialEq for Box<dyn ConfigurationManager>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§