use crate::scheme::SchemeId;
#[derive(Debug, Clone, Copy)]
pub enum ChildSelection {
All,
One(usize),
Many(&'static [usize]),
}
impl ChildSelection {
pub fn contains(&self, child_index: usize) -> bool {
match self {
ChildSelection::All => true,
ChildSelection::One(idx) => *idx == child_index,
ChildSelection::Many(indices) => indices.contains(&child_index),
}
}
}
#[derive(Debug, Clone, Copy)]
pub struct DescendantExclusion {
pub excluded: SchemeId,
pub children: ChildSelection,
}
#[derive(Debug, Clone, Copy)]
pub struct AncestorExclusion {
pub ancestor: SchemeId,
pub children: ChildSelection,
}