use super::*;
#[derive(Clone, Copy, Debug, Default)]
pub(crate) struct SelectorFxHasher {
pub(crate) hash: u64,
}
#[derive(CustomDebug)]
pub(crate) struct SelectorEntry<K> {
pub(crate) hash: u64,
#[debug(skip)]
pub(crate) key: K,
pub(crate) signal: Signal<bool>,
}
#[derive(CustomDebug)]
pub(crate) struct SelectorTable<K> {
#[debug(skip)]
pub(crate) entries: Vec<Option<SelectorEntry<K>>>,
pub(crate) len: usize,
}
#[derive(CustomDebug)]
pub(crate) struct SelectorState<K>
where
K: Clone + Eq + Hash + 'static,
{
#[debug(skip)]
pub(crate) active_key: Option<K>,
pub(crate) active_sig: Option<Signal<bool>>,
#[debug(skip)]
pub(crate) table: SelectorTable<K>,
}
#[derive(CustomDebug)]
pub struct Selector<K>
where
K: Clone + Eq + Hash + 'static,
{
#[debug(skip)]
pub(crate) state: Rc<RefCell<SelectorState<K>>>,
pub(crate) watcher: Effect,
}