Struct i_slint_core::item_tree::ComponentItemTree
source · pub struct ComponentItemTree<'a> { /* private fields */ }Expand description
The ComponentItemTree provides tree walking code for the physical ItemTree stored in
a Component without stitching any inter-Component links together!
Implementations§
source§impl<'a> ComponentItemTree<'a>
impl<'a> ComponentItemTree<'a>
sourcepub fn new(comp_ref_pin: &'a Pin<VRef<'a, ComponentVTable>>) -> Self
pub fn new(comp_ref_pin: &'a Pin<VRef<'a, ComponentVTable>>) -> Self
Create a new ItemTree from its raw data.
sourcepub fn get(&self, index: usize) -> Option<&ItemTreeNode>
pub fn get(&self, index: usize) -> Option<&ItemTreeNode>
Get a ItemTreeNode
sourcepub fn parent(&self, index: usize) -> Option<usize>
pub fn parent(&self, index: usize) -> Option<usize>
Get the parent of a node, returns None if this is the root node of this item tree.
sourcepub fn next_sibling(&self, index: usize) -> Option<usize>
pub fn next_sibling(&self, index: usize) -> Option<usize>
Returns the next sibling or None if this is the last sibling.
sourcepub fn previous_sibling(&self, index: usize) -> Option<usize>
pub fn previous_sibling(&self, index: usize) -> Option<usize>
Returns the previous sibling or None if this is the first sibling.
sourcepub fn first_child(&self, index: usize) -> Option<usize>
pub fn first_child(&self, index: usize) -> Option<usize>
Returns the first child or None if this are no children or the index
points to a DynamicTree.
sourcepub fn last_child(&self, index: usize) -> Option<usize>
pub fn last_child(&self, index: usize) -> Option<usize>
Returns the last child or None if this are no children or the index
points to an DynamicTree.
sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Returns the number of nodes in the ComponentItemTree
Trait Implementations§
source§impl<'a> From<&'a [ItemTreeNode]> for ComponentItemTree<'a>
impl<'a> From<&'a [ItemTreeNode]> for ComponentItemTree<'a>
source§fn from(item_tree: &'a [ItemTreeNode]) -> Self
fn from(item_tree: &'a [ItemTreeNode]) -> Self
Converts to this type from the input type.