Skip to main content

TreeNode

Struct TreeNode 

Source
pub struct TreeNode<'a> {
    pub concept_name: &'a str,
    pub labels: &'a [Label],
    pub depth: usize,
    pub fact_indices: Vec<usize>,
    pub children: Vec<TreeNode<'a>>,
}
Expand description

A single node in the presentation hierarchy.

Fields§

§concept_name: &'a str

Concept name (e.g. bs.ass).

§labels: &'a [Label]

All labels for this concept. The caller selects the desired language and role (e.g. terseLabel, label).

§depth: usize

Depth in the tree; root nodes have depth 0.

§fact_indices: Vec<usize>

Indices into the InstanceDocument::facts() slice for facts whose concept maps to this concept name.

Storing indices rather than references means the view’s lifetime is tied only to the taxonomy, leaving the instance free to be mutably borrowed while the view is alive.

§children: Vec<TreeNode<'a>>

Child nodes, ordered by the presentation arc order attribute.

Trait Implementations§

Source§

impl<'a> Debug for TreeNode<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for TreeNode<'a>

§

impl<'a> RefUnwindSafe for TreeNode<'a>

§

impl<'a> Send for TreeNode<'a>

§

impl<'a> Sync for TreeNode<'a>

§

impl<'a> Unpin for TreeNode<'a>

§

impl<'a> UnsafeUnpin for TreeNode<'a>

§

impl<'a> UnwindSafe for TreeNode<'a>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.