Skip to main content

ListItemContent

Trait ListItemContent 

Source
pub trait ListItemContent {
    // Required method
    fn ui(self, ui: &mut Ui, context: &ContentContext<'_>) -> Response;

    // Provided method
    fn interactive(&self) -> bool { ... }
}
Expand description

Trait for types that can be rendered as list item content

Implement this trait to create custom list item content types. The framework provides several built-in implementations:

Required Methods§

Source

fn ui(self, ui: &mut Ui, context: &ContentContext<'_>) -> Response

Paint the content inside context.rect and return the row response.

Provided Methods§

Source

fn interactive(&self) -> bool

Whether the row reacts to the pointer. Disabled content returns false.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§