Skip to main content

RenderItem

Trait RenderItem 

Source
pub trait RenderItem {
    // Required method
    fn render(&self, area: Rect, frame: &mut Frame<'_>, selected: bool);

    // Provided method
    fn height(&self) -> u16 { ... }
}
Expand description

Trait for items that can render themselves.

Implement this trait for item types that should render in a VirtualizedList.

Required Methods§

Source

fn render(&self, area: Rect, frame: &mut Frame<'_>, selected: bool)

Render the item into the frame at the given area.

Provided Methods§

Source

fn height(&self) -> u16

Height of this item in terminal rows.

Implementations on Foreign Types§

Source§

impl RenderItem for &str

Source§

fn render(&self, area: Rect, frame: &mut Frame<'_>, _selected: bool)

Source§

impl RenderItem for String

Source§

fn render(&self, area: Rect, frame: &mut Frame<'_>, _selected: bool)

Implementors§