pub trait AnyConfig: Send + Any {
// Required methods
fn status(&self) -> Var<ConfigStatus>;
fn get_raw(
&mut self,
key: ConfigKey,
default: RawConfigValue,
insert: bool,
) -> Var<RawConfigValue>;
fn contains_key(&mut self, key: ConfigKey) -> Var<bool>;
fn remove(&mut self, key: &ConfigKey) -> bool;
fn low_memory(&mut self);
}Expand description
Represents one or more config sources behind a dynamic reference.
See Config for the full trait.
Required Methods§
Sourcefn status(&self) -> Var<ConfigStatus>
fn status(&self) -> Var<ConfigStatus>
Gets a read-only variable that represents the IO status of the config.
Sourcefn get_raw(
&mut self,
key: ConfigKey,
default: RawConfigValue,
insert: bool,
) -> Var<RawConfigValue>
fn get_raw( &mut self, key: ConfigKey, default: RawConfigValue, insert: bool, ) -> Var<RawConfigValue>
Gets a weak typed variable to the config key.
This method is used when T cannot be passed because the config is behind a dynamic reference,
the backend must convert the value from the in memory representation to RawConfigValue.
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.
Sourcefn contains_key(&mut self, key: ConfigKey) -> Var<bool>
fn contains_key(&mut self, key: ConfigKey) -> Var<bool>
Gets a read-only variable that tracks if an entry for the key is in the backing storage.
Sourcefn remove(&mut self, key: &ConfigKey) -> bool
fn remove(&mut self, key: &ConfigKey) -> bool
Removes the key from the backing storage.
Any active config variable for the key will continue to work normally, retaining the last config value and re-inserting the key if assigned a new value.
Returns true if the key was found and will be removed in the next app update.
Returns false if the key was not found or the config is read-only.
Sourcefn low_memory(&mut self)
fn low_memory(&mut self)
Cleanup and flush RAM caches.