mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
big ass refactor (rip client)
This commit is contained in:
parent
94c1f83ef2
commit
8c3cf53c67
56 changed files with 2232 additions and 1891 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue