use core::widget::Widget;
pub trait App<Message> {
fn view(&self) -> impl Widget<Message>;
fn update(&mut self, message: Message, context: &mut impl AppContext);
}
pub trait AppContext {
fn terminate_app(&mut self);
}
impl AppContext for bool {
fn terminate_app(&mut self) {
*self = true
}
}