pub struct ItemTreeNodeArray<'a> { /* private fields */ }
Expand description
The ItemTreeNodeArray
provides tree walking code for the physical ItemTree stored in
a ItemTree
without stitching any inter-ItemTree links together!
Implementations§
Source§impl<'a> ItemTreeNodeArray<'a>
impl<'a> ItemTreeNodeArray<'a>
Sourcepub fn new(comp_ref_pin: &'a Pin<VRef<'a, ItemTreeVTable>>) -> Self
pub fn new(comp_ref_pin: &'a Pin<VRef<'a, ItemTreeVTable>>) -> Self
Create a new ItemTree
from its raw data.
Sourcepub fn get(&self, index: u32) -> Option<&ItemTreeNode>
pub fn get(&self, index: u32) -> Option<&ItemTreeNode>
Get a ItemTreeNode
Sourcepub fn parent(&self, index: u32) -> Option<u32>
pub fn parent(&self, index: u32) -> Option<u32>
Get the parent of a node, returns None
if this is the root node of this item tree.
Sourcepub fn next_sibling(&self, index: u32) -> Option<u32>
pub fn next_sibling(&self, index: u32) -> Option<u32>
Returns the next sibling or None
if this is the last sibling.
Sourcepub fn previous_sibling(&self, index: u32) -> Option<u32>
pub fn previous_sibling(&self, index: u32) -> Option<u32>
Returns the previous sibling or None
if this is the first sibling.
Sourcepub fn first_child(&self, index: u32) -> Option<u32>
pub fn first_child(&self, index: u32) -> Option<u32>
Returns the first child or None
if this are no children or the index
points to a DynamicTree
.
Sourcepub fn last_child(&self, index: u32) -> Option<u32>
pub fn last_child(&self, index: u32) -> Option<u32>
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 ItemTreeNodeArray
Trait Implementations§
Source§impl<'a> From<&'a [ItemTreeNode]> for ItemTreeNodeArray<'a>
impl<'a> From<&'a [ItemTreeNode]> for ItemTreeNodeArray<'a>
Source§fn from(item_tree: &'a [ItemTreeNode]) -> Self
fn from(item_tree: &'a [ItemTreeNode]) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for ItemTreeNodeArray<'a>
impl<'a> RefUnwindSafe for ItemTreeNodeArray<'a>
impl<'a> Send for ItemTreeNodeArray<'a>
impl<'a> Sync for ItemTreeNodeArray<'a>
impl<'a> Unpin for ItemTreeNodeArray<'a>
impl<'a> UnwindSafe for ItemTreeNodeArray<'a>
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
Mutably borrows from an owned value. Read more