i_slint_core::item_tree

Struct ItemTreeNodeArray

Source
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>

Source

pub fn new(comp_ref_pin: &'a Pin<VRef<'a, ItemTreeVTable>>) -> Self

Create a new ItemTree from its raw data.

Source

pub fn get(&self, index: u32) -> Option<&ItemTreeNode>

Get a ItemTreeNode

Source

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.

Source

pub fn next_sibling(&self, index: u32) -> Option<u32>

Returns the next sibling or None if this is the last sibling.

Source

pub fn previous_sibling(&self, index: u32) -> Option<u32>

Returns the previous sibling or None if this is the first sibling.

Source

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.

Source

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.

Source

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>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.