component generator

This commit is contained in:
2026-01-30 19:29:52 +01:00
parent 1f64b4f6e2
commit e85257a10e
6 changed files with 125 additions and 32 deletions
+6 -9
View File
@@ -4,7 +4,7 @@ use osui::prelude::*;
pub fn main() {
let engine = Benchmark::new(Console::new());
let benchmark_result = engine.run(App).expect("Failed to run engine");
let benchmark_result = engine.run(App {}).expect("Failed to run engine");
println!("Avg: {} μs", benchmark_result.average);
println!("Min: {} μs", benchmark_result.min);
println!("Max: {} μs", benchmark_result.max);
@@ -12,13 +12,10 @@ pub fn main() {
println!("Tot Render: {} μs", benchmark_result.total_render);
}
struct App;
impl ComponentImpl for App {
fn call(&self, cx: &Arc<Context>) -> View {
rsx! {
"Hello, world!"
}
.view(cx.clone())
#[component]
fn App(cx: &Arc<Context>) -> View {
rsx! {
"Hello, world!"
}
.view(cx.clone())
}