use crate::new::node_idx::NodeIdx;
pub type ArenaResult<T, I> = std::result::Result<T, ArenaError<I>>;
#[derive(Debug)]
#[derive(displaydoc::Display, thiserror::Error)]
pub enum ArenaError<I>
where
I: NodeIdx,
{
ParentOrdinalNotFound { node_idx: I, parent_idx: I },
ChildOrdinalNotFound { node_idx: I, child_idx: I },
ParentEdgeDoesNotExist { parent: I, child: I },
ChildEdgeDoesNotExist { parent: I, child: I },
InvalidNodeIdx(I),
}