big ass refactor (rip client)

This commit is contained in:
🪞👃🪞 2024-07-03 14:51:48 +03:00
parent 94c1f83ef2
commit 8c3cf53c67
56 changed files with 2232 additions and 1891 deletions

View file

@ -10,6 +10,26 @@ pub trait Handle {
}
}
#[macro_export] macro_rules! handle {
($T:ty) => {
impl Handle for $T {}
};
($T:ty |$self:ident, $e:ident|$block:tt) => {
impl Handle for $T {
fn handle (&mut $self, $e: &AppEvent) -> Usually<bool> {
$block
}
}
};
($T:ty = $handle:path) => {
impl Handle for $T {
fn handle (&mut self, e: &AppEvent) -> Usually<bool> {
$handle(self, e)
}
}
}
}
#[derive(Debug)]
pub enum AppEvent {
/// Terminal input