1use std::fmt::*;
2use crate::*;
3
4struct DebugContent<'a, E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize>(&'a ContentTreeRaw<E, I, IE, LE>);
5
6impl<'a, E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize> Debug for DebugContent<'a, E, I, IE, LE> {
7 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
8 f.debug_list()
9 .entries(self.0.iter())
10 .finish()
11 }
12}
13
14
15impl<E: ContentTraits, I: TreeMetrics<E>, const IE: usize, const LE: usize> Debug for ContentTreeRaw<E, I, IE, LE> {
16 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
17 f.debug_struct("ContentTree")
18 .field("count", &self.count)
19 .field("(content)", &DebugContent(self))
20 .finish()
21 }
22}