impl Trait(can run)

This commit is contained in:
RainBus
2024-10-12 11:54:27 +08:00
commit ef6f088fde
11 changed files with 824 additions and 0 deletions

13
src/view/component.rs Normal file
View File

@@ -0,0 +1,13 @@
use std::io;
use crossterm::event::Event;
use ratatui::widgets::Widget;
pub mod block;
pub mod input;
pub mod table;
pub trait Component {
fn widget(&self) -> impl Widget;
fn event_handler(&mut self, event: Event) -> io::Result<()>;
}