Skip to main content

CellImageSource

Trait CellImageSource 

Source
pub trait CellImageSource: 'static {
    // Required method
    fn image(&self, id: &str, window: &mut Window, cx: &mut App) -> CellImage;
}
Expand description

Finds the images of CellValue::Image cells by their ids.

Called in prepaint for every visible image cell, every frame, with the grid borrowed: it must not read, update or notify the grid entity. Look an id up by its hash and keep what was found: after the first frame an id costs no allocation. An image that becomes ready later must repaint the grid itself, as Window::use_asset does for the view being drawn.

Required Methods§

Source

fn image(&self, id: &str, window: &mut Window, cx: &mut App) -> CellImage

The image for id now.

Implementors§