plot/lib/display/
path_canonical_ctx.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.execut_dir.buf.display()));
18 lines.push(format!("{} str: {}", DrawTree::ENTRY_TERMINAL, self.execut_dir.str));
19
20 lines.push("🅱️ 🎯 select_dir (TARGET)".to_string());
22 lines.push(format!("{} buf: {}", DrawTree::ENTRY_BRANCH, self.select_dir.buf.display()));
23 lines.push(format!("{} str: {}", DrawTree::ENTRY_TERMINAL, self.select_dir.str));
24
25 lines.push("🆎🔗 relat_path (RELATIVE, BETWEEN CWD & TARGET)".to_string());
27 lines.push(format!("{} str: {}", DrawTree::ENTRY_TERMINAL, self.relat_path));
28
29 write!(f, "{}", lines.join("\n"))
31 }
32}