Skip to main content

Tree

Struct Tree 

Source
pub struct Tree { /* private fields */ }

Implementations§

Source§

impl Tree

Source

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.

Source

pub fn describe(&self, id: &str) -> Option<(&str, &'static str)>

Object id’s label and class.

Source

pub fn children(&self, id: &str) -> Vec<&str>

What object id holds directly.

Source

pub fn descendants(&self, id: &str) -> Vec<&str>

What object id holds, at any depth: its subtree in the containment.

Source

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.

Source

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.

Source

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).

Source

pub fn add_findings(&mut self, violations: &[(Option<usize>, Violation)])

Count each finding on its object, and each node’s subtree.

Source

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).

Trait Implementations§

Source§

impl Default for Tree

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for Tree

§

impl Freeze for Tree

§

impl Move for Tree

§

impl RefUnwindSafe for Tree

§

impl Send for Tree
where RawVecInner: Send, BoxRaw<str>: Send, &'static str: Send, RawTable<(String, u32)>: Send,

§

impl Sync for Tree
where RawVecInner: Sync, BoxRaw<str>: Sync, RawTable<(String, u32)>: Sync,

§

impl Unpin for Tree
where *const u8 is !null: Unpin, Box<str>: Unpin, &'static str: Unpin,

§

impl UnsafeUnpin for Tree

§

impl UnwindSafe for Tree

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.