Trait ItemDelegate

Source
pub trait ItemDelegate<I: Item> {
    // Required methods
    fn render(&self, m: &Model<I>, index: usize, item: &I) -> String;
    fn height(&self) -> usize;
    fn spacing(&self) -> usize;
    fn update(&self, msg: &Msg, m: &mut Model<I>) -> Option<Cmd>;
}
Expand description

A delegate encapsulates the functionality for a list item.

Required Methods§

Source

fn render(&self, m: &Model<I>, index: usize, item: &I) -> String

Renders the item’s view.

Source

fn height(&self) -> usize

The height of the list item.

Source

fn spacing(&self) -> usize

The spacing between list items.

Source

fn update(&self, msg: &Msg, m: &mut Model<I>) -> Option<Cmd>

The update loop for the item.

Implementors§

Source§

impl<I: Item + 'static> ItemDelegate<I> for DefaultDelegate