plot/lib/display/
anchored_paths_datum.rs1use super::DrawTree;
2use crate::lib::logic::{AnchoredPathsDatum, PathNode};
3
4impl std::fmt::Display for PathNode {
5 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6 write!(f, "{}", self.str)
8 }
9}
10
11impl std::fmt::Display for AnchoredPathsDatum {
12 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13 let mut lines = Vec::new();
14
15 lines.push("🅰️ 📍 execut_dir (CWD)".to_string());
17 lines.push(format!("{} buf: {}", DrawTree::ENTRY_BRANCH, self.execution_dir.buf.display()));
18 lines.push(format!("{} str: {}", DrawTree::ENTRY_TERMINAL, self.execution_dir.str));
19
20 lines.push("🅱️ 🎯 select_dir (TARGET)".to_string());
22 lines.push(format!("{} buf: {}", DrawTree::ENTRY_BRANCH, self.workspace_dir.buf.display()));
23 lines.push(format!("{} str: {}", DrawTree::ENTRY_TERMINAL, self.workspace_dir.str));
24
25 lines.push("🆎🔗 relat_path (RELATIVE, BETWEEN CWD & TARGET)".to_string());
27 lines.push(format!("{} str: {}", DrawTree::ENTRY_TERMINAL, self.to_relative_path()));
28
29 write!(f, "{}", lines.join("\n"))
31 }
32}