|
|
|
@ -98,3 +98,51 @@ impl HierarchicalLevel for Level3 {
|
|
|
|
|
impl HierarchicalLevel for Level2 {
|
|
|
|
|
type NextLevel = Level1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use core::fmt;
|
|
|
|
|
use core::fmt::Debug;
|
|
|
|
|
|
|
|
|
|
impl Debug for Table<Level4> {
|
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
|
|
|
|
// Ignore the 511th recursive entry
|
|
|
|
|
let entries = self.entries.iter().enumerate().filter(|(i, e)| !e.is_unused() && *i != 511usize);
|
|
|
|
|
for (i, e) in entries {
|
|
|
|
|
write!(f, "{:3}: {:?}\n", i, e)?;
|
|
|
|
|
write!(f, "{:?}", self.next_table(i).unwrap())?;
|
|
|
|
|
}
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Debug for Table<Level3> {
|
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
|
|
|
|
let entries = self.entries.iter().enumerate().filter(|(i, e)| !e.is_unused());
|
|
|
|
|
for (i, e) in entries {
|
|
|
|
|
write!(f, " {:3}: {:?}\n", i, e)?;
|
|
|
|
|
write!(f, "{:?}", self.next_table(i).unwrap())?;
|
|
|
|
|
}
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Debug for Table<Level2> {
|
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
|
|
|
|
let entries = self.entries.iter().enumerate().filter(|(i, e)| !e.is_unused());
|
|
|
|
|
for (i, e) in entries {
|
|
|
|
|
write!(f, " {:3}: {:?}\n", i, e)?;
|
|
|
|
|
write!(f, "{:?}", self.next_table(i).unwrap())?;
|
|
|
|
|
}
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Debug for Table<Level1> {
|
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
|
|
|
|
let entries = self.entries.iter().enumerate().filter(|(i, e)| !e.is_unused());
|
|
|
|
|
for (i, e) in entries {
|
|
|
|
|
write!(f, " {:3}: {:?}\n", i, e)?;
|
|
|
|
|
}
|
|
|
|
|
Ok(())
|
|
|
|
|
}
|
|
|
|
|
}
|