pub trait RenderItem {
// Required method
fn render(
&self,
area: Rect,
frame: &mut Frame<'_>,
selected: bool,
skip_rows: u16,
);
// 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§
Sourcefn render(
&self,
area: Rect,
frame: &mut Frame<'_>,
selected: bool,
skip_rows: u16,
)
fn render( &self, area: Rect, frame: &mut Frame<'_>, selected: bool, skip_rows: u16, )
Render the item into the frame at the given area.
§Arguments
area- The area to render into.frame- The frame to render into.selected- Whether the item is selected.skip_rows- Number of rows to skip from the top of the item content. This is non-zero when the item partially overlaps the top of the viewport.