Skip to main content

euv_cli/hmr/
struct.rs

1use super::*;
2
3/// A serializable bag of preserved state entries.
4///
5/// Each entry is a `(key, value)` string pair. The
6/// caller is responsible for serializing non-string
7/// values (numbers, booleans, etc.) to strings before
8/// insertion.
9///
10/// # Wire format
11///
12/// ```json
13/// {"entries": {"k1": "v1", "k2": "v2"}}
14/// ```
15#[derive(Clone, Data, Debug, Default, Eq, PartialEq)]
16pub struct HmrState {
17    /// The preserved entries, keyed by name.
18    #[get(pub(crate))]
19    #[get_mut(pub(crate))]
20    #[set(pub(crate))]
21    pub(crate) entries: HashMap<String, String>,
22}