bitstring_trees/tree/
walk_dir.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/// Remember which path was taken to reach this node from the parent in [`WalkMutOwned`] and [`WalkMutBorrowed`].
///
/// [`WalkMutOwned`]: super::WalkMutOwned
/// [`WalkMutBorrowed`]: super::WalkMutBorrowed
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WalkedDirection {
	/// Entered first node in tree
	Down,
	/// Entered left node
	Left,
	/// Entered right node
	Right,
}

impl WalkedDirection {
	/// [`Self::Right`] if `side` is true otherwise [`Self::Left`]
	pub fn from_side(side: bool) -> Self {
		if side {
			Self::Right
		} else {
			Self::Left
		}
	}
}

impl From<WalkedDirection> for () {
	fn from(_: WalkedDirection) -> Self {}
}