pub trait Element<'s> {
// Required methods
fn width(&self) -> usize;
fn render(&self) -> impl DoubleEndedIterator<Item = RenderChunk<'s>>;
}Expand description
A particular widget that can be rendered to the TUI.
§Lifetime parameter
The 's lifetime parameter indicates the lifetime of any values (e.g.,
strings) borrowed by the Element. For example:
use line_ui::element::Text;
let my_string = String::from("hello");
let my_element = Text::new(&my_string);Here, my_element implements Element<'s>, where 's is the lifetime
of my_string.
Required Methods§
Sourcefn render(&self) -> impl DoubleEndedIterator<Item = RenderChunk<'s>>
fn render(&self) -> impl DoubleEndedIterator<Item = RenderChunk<'s>>
Renders the element into a sequence of chunks.
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.