1use crate::shapemap_state::*;
2use std::collections::HashSet;
3
4pub trait ShapeMap {
7 type NodeIdx;
8 type ShapeIdx;
9
10 fn nodes_conform(&self, shape: &Self::ShapeIdx) -> HashSet<&Self::NodeIdx>;
13
14 fn state(&self, node: &Self::NodeIdx, shape: &Self::ShapeIdx) -> &ShapeMapState;
15
16 fn nodes(&self) -> HashSet<&Self::NodeIdx>;
17
18 fn shapes(&self) -> HashSet<&Self::ShapeIdx>;
19
20 fn add_pending(&mut self, node: &Self::NodeIdx, shape: &Self::ShapeIdx);
21
22 fn add_conforms(&mut self, node: &Self::NodeIdx, shape: &Self::ShapeIdx);
23
24 fn add_fails(&mut self, node: &Self::NodeIdx, shape: &Self::ShapeIdx);
25}