zng::config

Type Alias RonConfig

Source
pub type RonConfig = SyncConfig<IndexMap<Txt, Value>>;
Expand description

Represents a config source that synchronizes with a RON file.

Aliased Type§

struct RonConfig { /* private fields */ }

Implementations

Source§

impl<M> SyncConfig<M>
where M: ConfigMap,

Source

pub fn sync(file: impl Into<PathBuf>) -> SyncConfig<M>

Open write the file

Trait Implementations

Source§

impl<M> AnyConfig for SyncConfig<M>
where M: ConfigMap,

Source§

fn get_raw( &mut self, key: Txt, default: RawConfigValue, insert: bool, shared: bool, ) -> Box<dyn VarBoxed<RawConfigValue>>

Gets a weak typed variable to the config key. Read more
Source§

fn contains_key(&mut self, key: Txt) -> Box<dyn VarBoxed<bool>>

Gets a read-only variable that tracks if an entry for the key is in the backing storage.
Source§

fn status(&self) -> Box<dyn VarBoxed<ConfigStatus>>

Gets a read-only variable that represents the IO status of the config.
Source§

fn remove(&mut self, key: &Txt) -> bool

Removes the key from the backing storage. Read more
Source§

fn low_memory(&mut self)

Cleanup and flush RAM caches.
Source§

impl<M> Config for SyncConfig<M>
where M: ConfigMap,

Source§

fn get<T>( &mut self, key: impl Into<Txt>, default: T, insert: bool, ) -> Box<dyn VarBoxed<T>>
where T: ConfigValue,

Gets a variable that is bound to the config key. Read more