1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub struct Depth { depth: i32, } impl Depth { pub fn zero() -> Self { Self { depth: 0 } } pub fn next(self) -> Self { Self { depth: self.depth + 1, } } }