RepeatedItemTree

Trait RepeatedItemTree 

Source
pub trait RepeatedItemTree:
    ItemTree
    + HasStaticVTable<ItemTreeVTable>
    + 'static {
    type Data: 'static;

    // Required method
    fn update(&self, index: usize, data: Self::Data);

    // Provided methods
    fn init(&self) { ... }
    fn listview_layout(
        self: Pin<&Self>,
        _offset_y: &mut LogicalLength,
    ) -> LogicalLength { ... }
    fn box_layout_data(
        self: Pin<&Self>,
        _orientation: Orientation,
    ) -> BoxLayoutCellData { ... }
}
Expand description

ItemTree that can be instantiated by a repeater.

Required Associated Types§

Source

type Data: 'static

The data corresponding to the model

Required Methods§

Source

fn update(&self, index: usize, data: Self::Data)

Update this ItemTree at the given index and the given data

Provided Methods§

Source

fn init(&self)

Called once after the ItemTree has been instantiated and update() was called once.

Source

fn listview_layout( self: Pin<&Self>, _offset_y: &mut LogicalLength, ) -> LogicalLength

Layout this item in the listview

offset_y is the y position where this item should be placed. it should be updated to be to the y position of the next item.

Returns the minimum item width which will be used to compute the listview’s viewport width

Source

fn box_layout_data( self: Pin<&Self>, _orientation: Orientation, ) -> BoxLayoutCellData

Returns what’s needed to perform the layout if this ItemTrees is in a box layout

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§