tola_caps/trie/
inspect.rs1use super::node::{Empty, Leaf, Node16};
6use super::capability::Capability;
7
8pub trait Inspect {
13 fn inspect<F: FnMut(&'static str)>(&self, f: F);
15}
16
17impl Inspect for Empty {
18 fn inspect<F: FnMut(&'static str)>(&self, _f: F) {}
19}
20
21impl<C: Capability> Inspect for Leaf<C> {
22 fn inspect<F: FnMut(&'static str)>(&self, mut f: F) {
23 f(core::any::type_name::<C>());
24 }
25}
26
27#[macros::node16(each_slot)]
29impl<_Slots_> Inspect for _Node16_
30where
31 each(_Slots_): Inspect + Default,
32{
33 fn inspect<F: FnMut(&'static str)>(&self, mut f: F) {
34 <_Slot_ as Inspect>::inspect(&<_Slot_>::default(), &mut f);
36 }
37}