hUI/hui/src/state.rs

14 lines
376 B
Rust
Raw Normal View History

2024-02-27 13:31:12 -06:00
//! state managment for stateful elements
2024-02-17 14:43:46 -06:00
use hashbrown::{HashMap, HashSet};
use nohash_hasher::BuildNoHashHasher;
use std::any::Any;
2024-02-18 10:22:31 -06:00
//TODO impl StateRepo functions and automatic cleanup of inactive ids
2024-02-17 14:43:46 -06:00
#[derive(Default)]
pub struct StateRepo {
state: HashMap<u64, Box<dyn Any>, BuildNoHashHasher<u64>>,
active_ids: HashSet<u64, BuildNoHashHasher<u64>>
}