[Wip] CLI & Daemon

This commit is contained in:
Alex 2026-07-25 18:23:36 +02:00
commit 6a535099bb
Signed by: alex
SSH key fingerprint: SHA256:D1+Ub8o0v4K5y1JNivW8IxEOelqLSvPmUzBbDIoZkRQ
44 changed files with 4417 additions and 303 deletions

View file

@ -2,7 +2,7 @@ use std::fmt::{Debug, Formatter};
use std::future::Future;
use std::pin::Pin;
use crate::screens::screens::Screen;
use crate::screens::screens::{Screen, UiEvent};
#[allow(unused)]
pub enum InteractionResult {
@ -13,6 +13,9 @@ pub enum InteractionResult {
OpenFutureScreen {
screen: Pin<Box<dyn Future<Output = Box<dyn Screen>> + Send>>,
},
AppTask {
task: Pin<Box<dyn Future<Output = UiEvent> + Send>>,
},
Handled,
Unhandled,
}
@ -22,6 +25,7 @@ impl Debug for InteractionResult {
match self {
InteractionResult::OpenScreen { screen: _ } => write!(f, "OpenScreen"),
InteractionResult::OpenFutureScreen { screen: _ } => write!(f, "OpenFutureScreen"),
InteractionResult::AppTask { task: _ } => write!(f, "AppTask"),
InteractionResult::CloseScreen => write!(f, "CloseScreen"),
InteractionResult::Handled => write!(f, "Handled"),
InteractionResult::Unhandled => write!(f, "Unhandled"),
@ -36,6 +40,9 @@ impl PartialEq for InteractionResult {
InteractionResult::OpenScreen { screen: _ },
InteractionResult::OpenScreen { screen: _ },
) => true,
(InteractionResult::AppTask { task: _ }, InteractionResult::AppTask { task: _ }) => {
true
}
(
InteractionResult::OpenFutureScreen { screen: _ },
InteractionResult::OpenFutureScreen { screen: _ },