teo_parser/traits/named_identifiable.rs
1pub trait NamedIdentifiable {
2
3 fn string_path(&self) -> &Vec<String>;
4
5 fn str_path(&self) -> Vec<&str> {
6 self.string_path().iter().map(AsRef::as_ref).collect()
7 }
8
9 fn name(&self) -> &str {
10 *self.str_path().last().unwrap()
11 }
12
13 fn parent_string_path(&self) -> Vec<String> {
14 let mut result = self.string_path().clone();
15 result.pop();
16 result
17 }
18}
19