use tek_tui::{*, tek_layout::{*, tek_engine::*}}; use tek_edn::*; use std::sync::{Arc, RwLock}; const EDN: &'static str = include_str!("edn02.edn"); fn main () -> Usually<()> { let state = Arc::new(RwLock::new(Example)); Tui::new().unwrap().run(&state)?; Ok(()) } pub struct Example; impl EdnLayout for &Example { fn get_content <'a> (&'a self, sym: &'a str) -> RenderBox<'a, Tui> { Box::new(Thunk::new(move||match sym { ":hello" => "Hello", ":world" => "world", _ => "" })) } } impl Content for Example { fn content (&self) -> impl Render { EdnView::new(self, EDN).unwrap() } } impl Handle for Example {}