logo
pub trait RepeatedComponent: Component + HasStaticVTable<ComponentVTable> + 'static {
    type Data: 'static;

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

    fn listview_layout(
        self: Pin<&Self>,
        _offset_y: &mut Coord,
        _viewport_width: Pin<&Property<Coord>>
    ) { ... } fn box_layout_data(
        self: Pin<&Self>,
        _orientation: Orientation
    ) -> BoxLayoutCellData { ... } }
Expand description

Component that can be instantiated by a repeater.

Required Associated Types

The data corresponding to the model

Required Methods

Update this component at the given index and the given data

Provided Methods

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 what’s needed to perform the layout if this component is in a box layout

Implementors