Struct Tree
pub struct Tree<I>where
I: GenerationalId,{
pub parent: Vec<Option<I>>,
pub first_child: Vec<Option<I>>,
pub next_sibling: Vec<Option<I>>,
pub prev_sibling: Vec<Option<I>>,
pub ignored: Vec<bool>,
pub window: Vec<bool>,
pub lock_focus_within: Vec<bool>,
pub changed: bool,
}
Expand description
The Tree describes the tree of entities.
Fields§
§parent: Vec<Option<I>>
§first_child: Vec<Option<I>>
§next_sibling: Vec<Option<I>>
§prev_sibling: Vec<Option<I>>
§ignored: Vec<bool>
§window: Vec<bool>
§lock_focus_within: Vec<bool>
§changed: bool
Implementations§
§impl<I> Tree<I>where
I: GenerationalId,
impl<I> Tree<I>where
I: GenerationalId,
pub fn get_child_index(&self, entity: I) -> Option<usize>
pub fn get_last_child(&self, entity: I) -> Option<&I>
pub fn get_last_child(&self, entity: I) -> Option<&I>
Returns the last child of an entity.
pub fn get_num_children(&self, entity: I) -> Option<u32>
pub fn get_num_children(&self, entity: I) -> Option<u32>
Returns the number of children of an entity.
pub fn is_ignored(&self, entity: I) -> bool
pub fn is_ignored(&self, entity: I) -> bool
Returns true if the node should be skipped by layout
pub fn lock_focus_within(&self, entity: I) -> I
pub fn lock_focus_within(&self, entity: I) -> I
Returns the first ancestor to have the lock_focus_within flag set
pub fn get_layout_parent(&self, entity: I) -> Option<I>
pub fn get_layout_parent(&self, entity: I) -> Option<I>
Returns the first ancestor of an entity which is not ignored
pub fn get_parent(&self, entity: I) -> Option<I>
pub fn get_parent(&self, entity: I) -> Option<I>
Returns the parent of an entity.
pub fn get_parent_window(&self, entity: I) -> Option<I>
pub fn get_first_child(&self, entity: I) -> Option<I>
pub fn get_first_child(&self, entity: I) -> Option<I>
Returns the first child of an entity or None
if there isn’t one.
pub fn get_layout_first_child(&self, entity: I) -> Option<I>
pub fn get_next_sibling(&self, entity: I) -> Option<I>
pub fn get_next_sibling(&self, entity: I) -> Option<I>
Returns the next sibling of an entity or None
if t here isn’t one.
pub fn get_next_layout_sibling(&self, entity: I) -> Option<I>
pub fn get_next_layout_sibling(&self, entity: I) -> Option<I>
Returns the next layout sibling of an entity or None
if t here isn’t one.
pub fn get_prev_sibling(&self, entity: I) -> Option<I>
pub fn get_prev_sibling(&self, entity: I) -> Option<I>
Returns the previous sibling of an entity or None
if there isn’t one.
pub fn get_prev_layout_sibling(&self, entity: I) -> Option<I>
pub fn get_prev_layout_sibling(&self, entity: I) -> Option<I>
Returns the previous layout sibling of an entity or None
if there isn’t one.
pub fn is_first_child(&self, entity: I) -> bool
pub fn is_first_child(&self, entity: I) -> bool
Returns true if the entity is the first child of its parent.
pub fn is_last_child(&self, entity: I) -> bool
pub fn is_last_child(&self, entity: I) -> bool
Returns true if the entity is the last child of its parent.
pub fn is_sibling(&self, entity1: I, entity2: I) -> bool
pub fn has_children(&self, entity: I) -> bool
pub fn has_children(&self, entity: I) -> bool
Returns true if the entity has children.
pub fn remove(&mut self, entity: I) -> Result<(), TreeError>
pub fn remove(&mut self, entity: I) -> Result<(), TreeError>
Removes an entity from the tree
This method assumes that a check if the entity is alive has already been done prior to calling this method.
pub fn set_first_child(&mut self, entity: I) -> Result<(), TreeError>
pub fn set_first_child(&mut self, entity: I) -> Result<(), TreeError>
Makes the entity the first child of its parent.
pub fn set_next_sibling( &mut self, entity: I, sibling: I, ) -> Result<(), TreeError>
pub fn set_prev_sibling( &mut self, entity: I, sibling: I, ) -> Result<(), TreeError>
pub fn set_parent(&mut self, entity: I, parent: I)
pub fn set_ignored(&mut self, entity: I, flag: bool)
pub fn set_window(&mut self, entity: I, flag: bool)
pub fn set_lock_focus_within(&mut self, entity: I, flag: bool)
Trait Implementations§
§impl<I> Clone for Tree<I>where
I: Clone + GenerationalId,
impl<I> Clone for Tree<I>where
I: Clone + GenerationalId,
§impl<I> Debug for Tree<I>where
I: Debug + GenerationalId,
impl<I> Debug for Tree<I>where
I: Debug + GenerationalId,
§impl<'a, I> IntoIterator for &'a Tree<I>where
I: GenerationalId,
impl<'a, I> IntoIterator for &'a Tree<I>where
I: GenerationalId,
Auto Trait Implementations§
impl<I> Freeze for Tree<I>
impl<I> RefUnwindSafe for Tree<I>where
I: RefUnwindSafe,
impl<I> Send for Tree<I>where
I: Send,
impl<I> Sync for Tree<I>where
I: Sync,
impl<I> Unpin for Tree<I>where
I: Unpin,
impl<I> UnwindSafe for Tree<I>where
I: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.