use super::node::{Empty, Leaf, Node16};
use super::capability::Capability;
pub trait Inspect {
fn inspect<F: FnMut(&'static str)>(&self, f: F);
}
impl Inspect for Empty {
fn inspect<F: FnMut(&'static str)>(&self, _f: F) {}
}
impl<C: Capability> Inspect for Leaf<C> {
fn inspect<F: FnMut(&'static str)>(&self, mut f: F) {
f(core::any::type_name::<C>());
}
}
#[macros::node16(each_slot)]
impl<_Slots_> Inspect for _Node16_
where
each(_Slots_): Inspect + Default,
{
fn inspect<F: FnMut(&'static str)>(&self, mut f: F) {
<_Slot_ as Inspect>::inspect(&<_Slot_>::default(), &mut f);
}
}