[−][src]Struct orbtk_tree::Tree
Base data structure to manage the entities of a window in a tree based structure.
Fields
root: Option<Entity>
overlay: Option<Entity>
children: BTreeMap<Entity, Vec<Entity>>
parent: BTreeMap<Entity, Option<Entity>>
Implementations
impl Tree
[src]
pub fn new() -> Self
[src]
Creates a new tree with default values.
pub fn root(&self) -> Entity
[src]
Returns the root of the tree.
pub fn start_node(&self, start_node: impl Into<Entity>) -> &Self
[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 set_overlay(&mut self, overlay: impl Into<Entity>)
[src]
pub fn append_child(
&mut self,
parent: impl Into<Entity>,
child: impl Into<Entity>
) -> Result<Entity, NotFound>
[src]
&mut self,
parent: impl Into<Entity>,
child: impl Into<Entity>
) -> Result<Entity, NotFound>
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 Clone for Tree
[src]
impl Debug for Tree
[src]
impl Default for Tree
[src]
impl EntityStore for Tree
[src]
fn register_entity(&mut self, entity: impl Into<Entity>)
[src]
fn remove_entity(&mut self, entity: impl Into<Entity>)
[src]
impl<'a> IntoIterator for &'a Tree
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Tree
impl Send for Tree
impl !Sync for Tree
impl Unpin for Tree
impl UnwindSafe for Tree
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<E> Component for E where
E: Any,
[src]
E: Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,