Mountain/RPC/Configuration/ConfigurationService.rs
1
2//! Configuration read/write service.
3
4use std::collections::HashMap;
5
6pub struct Struct {
7 config:HashMap<String, serde_json::Value>,
8}
9
10impl Struct {
11 pub fn new() -> Self { Self { config:HashMap::new() } }
12
13 pub fn get(&self, Key:&str) -> Option<&serde_json::Value> { self.config.get(Key) }
14
15 pub fn set(&mut self, Key:String, Value:serde_json::Value) { self.config.insert(Key, Value); }
16}
17
18impl Default for Struct {
19 fn default() -> Self { Self::new() }
20}