summaryrefslogtreecommitdiff
path: root/subplotlib/helpers/subplotlib_context.rs
blob: b986ed254f4a39b71c4eb4c1edf65c56d6a5a658 (plain)
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
use std::collections::HashMap;

struct Context {
    counter: usize,
    files: HashMap<String, SubplotDataFile>,
    this_file: Option<SubplotDataFile>,
}

impl Default for Context {
    fn default() -> Self {
        Self {
            counter: 0,
            files: HashMap::new(),
            this_file: None,
        }
    }
}

impl Context {
    fn remember_file(&mut self, name: &str, content: SubplotDataFile) {
        self.files.insert(name.to_string(), content);
    }
}

impl ContextElement for Context {
    // An empty implementation is sufficient for now
}