1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use std::collections::HashMap;
use crate::engine::d2::subsystem::StorageSystem;
use super::Dynamic;
pub struct DummyStorage {
hash: HashMap<String, Dynamic>,
}
impl DummyStorage {
pub fn new() -> Self {
Self {
hash: HashMap::new(),
}
}
}
impl StorageSystem for DummyStorage {
fn is_supported(&self) -> bool {
false
}
fn set<A>(&self, key: String, value: A) -> bool {
unimplemented!()
}
fn get<A>(&self, key: String) -> Option<&A> {
unimplemented!()
}
fn remove(&mut self, key: String) {
self.hash.remove(&key);
}
fn clear(&mut self) {
self.hash.clear();
}
}