parallel_disk_usage/visualizer/parenthood.rs
1/// Whether a node in a tree has children.
2#[derive(Debug, Clone, Copy, PartialEq, Eq)]
3pub enum Parenthood {
4 /// The node has no children.
5 Childless,
6 /// The node has children.
7 Parent,
8}
9
10impl Parenthood {
11 /// Deduce parenthood from the number of children.
12 pub const fn from_children_count(children_count: usize) -> Self {
13 if children_count == 0 {
14 Parenthood::Childless
15 } else {
16 Parenthood::Parent
17 }
18 }
19}