Trait AsWidget

Source
pub trait AsWidget {
    // Required method
    fn as_widget<'a>(&'a self, is_highlighted: bool) -> (impl Widget + 'a, Size);

    // Provided method
    fn set_highlighted(&mut self, is_highlighted: bool) { ... }
}
Expand description

A trait for types that can be converted into a Ratatui widget for display

Required Methods§

Source

fn as_widget<'a>(&'a self, is_highlighted: bool) -> (impl Widget + 'a, Size)

Converts the object into a Ratatui widget and its size

Provided Methods§

Source

fn set_highlighted(&mut self, is_highlighted: bool)

Sets the highlighted status

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§