zng_ext_config/toml.rs
1use super::*;
2
3/// Represents a config source that synchronizes with a TOML file.
4pub type TomlConfig = SyncConfig<TomlBackend>;
5
6#[doc(hidden)]
7pub struct TomlBackend;
8impl SyncConfigBackend for TomlBackend {
9 fn read(mut file: WatchFile) -> io::Result<RawConfigMap> {
10 file.toml()
11 }
12
13 fn write(file: &mut WriteFile, map: &RawConfigMap) -> io::Result<()> {
14 file.write_toml(map, true)
15 }
16}