1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use crate::{Event, Node}; pub trait Component<MSG> { fn update(&mut self, msg: MSG); fn on_event(&mut self, event: Event) { // only tui backend use this } fn debug(&mut self, s: String) { // only tui backend use this } fn view(&self) -> Node<MSG>; }