use crate::cmd::Cmd;
use crate::element::Element;
pub trait Model: Send + 'static {
type Msg: Send + 'static;
fn init(&mut self) -> Option<Cmd<Self::Msg>> {
None
}
fn update(&mut self, msg: Self::Msg) -> Option<Cmd<Self::Msg>>;
fn view(&self) -> String;
fn cursor(&self) -> Option<(u16, u16)> {
None
}
}
pub trait ElementModel: Send + 'static {
type Msg: Send + 'static;
fn init(&mut self) -> Option<Cmd<Self::Msg>> {
None
}
fn update(&mut self, msg: Self::Msg) -> Option<Cmd<Self::Msg>>;
fn view(&self) -> Element<Self::Msg>;
}