re-add tui_main, fixing examples

This commit is contained in:
i do not exist 2026-04-15 11:11:36 +03:00
parent a93fe92a59
commit 6c382e2627
7 changed files with 89 additions and 44 deletions

View file

@ -2,13 +2,13 @@ use crate::task::Task;
use ::std::sync::{Arc, RwLock, atomic::{AtomicBool, Ordering::*}};
use ::std::time::Duration;
use ::dizzle::{Usually, Do, impl_from};
use ::dizzle::{Usually, Apply, impl_from};
use ::crossterm::event::{
read, Event, KeyEvent, KeyCode, KeyModifiers, KeyEventKind, KeyEventState
};
/// Spawn the TUI input thread which reads keys from the terminal.
pub fn tui_input <T: Do<TuiEvent, Usually<T>> + Send + Sync + 'static> (
pub fn tui_input <T: Apply<TuiEvent, Usually<T>> + Send + Sync + 'static> (
exited: &Arc<AtomicBool>, state: &Arc<RwLock<T>>, poll: Duration
) -> Result<Task, std::io::Error> {
let exited = exited.clone();