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