pub trait ElementModel: Send + 'static {
type Msg: Send + 'static;
// Required methods
fn update(&mut self, msg: Self::Msg) -> Option<Cmd<Self::Msg>>;
fn view(&self) -> Element<Self::Msg>;
// Provided method
fn init(&mut self) -> Option<Cmd<Self::Msg>> { ... }
}Expand description
A TEA model with Element tree rendering and Flexbox layout.
This is the recommended trait for building terminal UIs. The view() method
returns an Element tree that is laid out using Flexbox and rendered
incrementally.
Required Associated Types§
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".