Skip to main content

zintl_ui_view/
storage.rs

1use std::any::Any;
2use std::collections::HashMap;
3use std::sync::Arc;
4
5/// Persistent key-value storage for [`View`].
6#[derive(Clone, Debug)]
7pub struct Storage {
8    data: Arc<HashMap<String, Arc<dyn Any>>>,
9}
10
11impl Storage {
12    pub fn new() -> Self {
13        Storage {
14            data: HashMap::new().into(),
15        }
16    }
17}