[][src]Struct orbtk::tree::Tree

pub struct Tree {
    pub root: Entity,
    pub children: BTreeMap<Entity, Vec<Entity>>,
    pub parent: BTreeMap<Entity, Option<Entity>>,
    // some fields omitted
}

Base data structure to manage the entity entities of a window in a tree based structure.

Fields

root: Entitychildren: BTreeMap<Entity, Vec<Entity>>parent: BTreeMap<Entity, Option<Entity>>

Methods

impl Tree[src]

pub fn new() -> Tree[src]

Creates a new tree with default values.

pub fn start_node(&self, start_node: impl Into<Entity>) -> &Tree[src]

pub fn register_node(&mut self, entity: impl Into<Entity>)[src]

Registers a new entity entity as node.

pub fn set_root(&mut self, root: impl Into<Entity>)[src]

Sets the root.

pub fn append_child(
    &mut self,
    parent: impl Into<Entity>,
    child: impl Into<Entity>
) -> Result<Entity, NotFound>
[src]

Appends a child entity to the given parent entity. Raised NotFound error if the parent is not part of the tree.

pub fn len(&self) -> usize[src]

Returns the number of all entities in the tree.

pub fn is_empty(&self) -> bool[src]

Returns true if the tree has no entities.

Trait Implementations

impl System<Tree, StringComponentStore> for EventStateSystem[src]

impl System<Tree, StringComponentStore> for InitSystem[src]

impl System<Tree, StringComponentStore> for LayoutSystem[src]

impl System<Tree, StringComponentStore> for PostLayoutStateSystem[src]

impl System<Tree, StringComponentStore> for RenderSystem[src]

impl Debug for Tree[src]

impl Default for Tree[src]

impl EntityStore for Tree[src]

impl<'a> IntoIterator for &'a Tree[src]

type Item = Entity

The type of the elements being iterated over.

type IntoIter = TreeIterator<'a>

Which kind of iterator are we turning this into?

impl Clone for Tree[src]

Auto Trait Implementations

impl Send for Tree

impl !Sync for Tree

impl Unpin for Tree

impl UnwindSafe for Tree

impl !RefUnwindSafe for Tree

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<E> Component for E where
    E: Any
[src]

impl<T> SetParameter for T