logo
pub trait ItemTreeBuilder {
    type SubComponentState: Clone;
    fn push_repeated_item(
        &mut self,
        item: &ElementRc,
        repeater_count: u32,
        parent_index: u32,
        component_state: &Self::SubComponentState
    );
fn push_native_item(
        &mut self,
        item: &ElementRc,
        children_offset: u32,
        parent_index: u32,
        component_state: &Self::SubComponentState
    );
fn enter_component(
        &mut self,
        item: &ElementRc,
        sub_component: &Rc<Component>,
        children_offset: u32,
        component_state: &Self::SubComponentState
    ) -> Self::SubComponentState;
fn enter_component_children(
        &mut self,
        item: &ElementRc,
        repeater_count: u32,
        component_state: &Self::SubComponentState,
        sub_component_state: &Self::SubComponentState
    ); }
Expand description

A reference to this trait is passed to the build_item_tree function. It can be used to build the array for the item tree.

Associated Types

Some state that contains the code on how to access some particular component

Required methods

Called when a component is entered, this allow to change the component_state. The returned SubComponentState will be used for all the items within that component

Called before the children of a component are entered.

Implementors