pub struct Tree { /* private fields */ }Implementations§
Source§impl Tree
impl Tree
Sourcepub fn search(
&self,
query: &str,
limit: usize,
) -> Vec<(&str, &str, &'static str)>
pub fn search( &self, query: &str, limit: usize, ) -> Vec<(&str, &str, &'static str)>
The objects whose name or mRID holds query (ignoring case), at most
limit: a name equal to it first, then one starting with it, then one
holding it, then an mRID holding it; by name within each.
Sourcepub fn descendants(&self, id: &str) -> Vec<&str>
pub fn descendants(&self, id: &str) -> Vec<&str>
What object id holds, at any depth: its subtree in the containment.
Sourcepub fn chain(&self, id: &str) -> Vec<u32>
pub fn chain(&self, id: &str) -> Vec<u32>
Object id‘s node in the containment and its containers’ before it,
outermost first, as node numbers; empty if it is not in the tree.
Sourcepub fn containers(&self, id: &str) -> Vec<&str>
pub fn containers(&self, id: &str) -> Vec<&str>
The labels of the containers of object id, outermost first; the
regions left out below a substation or line.
Sourcepub fn path(&self, id: &str, only_findings: bool) -> Option<Vec<String>>
pub fn path(&self, id: &str, only_findings: bool) -> Option<Vec<String>>
The keys the view expands to reach object id in Geographical or Not
contained, from its section on, the class groups and pages a long
level is split into included; None if it is not listed (filtered out).
Sourcepub fn add_findings(&mut self, violations: &[(Option<usize>, Violation)])
pub fn add_findings(&mut self, violations: &[(Option<usize>, Violation)])
Count each finding on its object, and each node’s subtree.
Sourcepub fn children_json(
&self,
set: &impl Locations,
grid: &Grid,
key: Option<&str>,
only_findings: bool,
) -> Option<Value>
pub fn children_json( &self, set: &impl Locations, grid: &Grid, key: Option<&str>, only_findings: bool, ) -> Option<Value>
The children of node key, or the sections for None, for the view:
each with its key, label, class, number of children, findings, where
it is written and where the grid view shows it. None for a key the
tree does not have (any more).