App structure

This commit is contained in:
2026-07-14 12:15:50 -04:00
parent 7747eeae7c
commit a0d3e28a8b
+21
View File
@@ -2,3 +2,24 @@ pub mod layout;
pub mod render;
pub mod unit;
pub mod widget;
pub trait App {
// Rendering
fn layout(&self) -> layout::Allocation;
fn render(&mut self, layout: layout::Allocation);
// State
fn init(&mut self);
fn update(&mut self);
fn refresh(&mut self) {
self.render(self.layout());
}
// Run
fn run(&mut self) {
self.init();
self.refresh();
}
}