create driven example for tui renderer

This commit is contained in:
Evan Almloff committed 2023-02-07 14:14:04 -06:00
1 parent c805bc25af
commit 71e34452da
10 files changed
+276 -34

No files matched your search

+3 -5
View File
@@ -35,10 +35,8 @@ pub type FxDashMap<K, V> = dashmap::DashMap<K, V, BuildHasherDefault<FxHasher>>;
pub type FxDashSet<K> = dashmap::DashSet<K, BuildHasherDefault<FxHasher>>;
pub type SendAnyMap = anymap::Map<dyn Any + Send + Sync + 'static>;
pub trait Renderer<V: FromAnyValue + Send + Sync, E> {
pub trait Renderer<E, V: FromAnyValue + Send + Sync = ()> {
fn render(&mut self, root: NodeMut<V>);
fn handle_event(&mut self, node: NodeMut<V>, event: &str, value: E);
fn poll_async(&mut self) -> Pin<Box<dyn Future<Output = ()> + Send>> {
Box::pin(async {})
}
fn handle_event(&mut self, node: NodeMut<V>, event: &str, value: E, bubbles: bool);
fn poll_async(&mut self) -> Pin<Box<dyn Future<Output = ()> + Send>>;
}