Command Input

This commit is contained in:
2026-07-15 10:55:47 +02:00
parent 23a79f2db6
commit eb670ffe8c
4 changed files with 124 additions and 10 deletions
+10
View File
@@ -10,6 +10,7 @@ pub struct Context {
pub(crate) tx: Sender<Box<dyn Any + Send + Sync>>,
}
#[derive(Debug)]
pub struct State<T> {
pub value: Arc<Mutex<T>>,
tx: Sender<Box<dyn Any + Send + Sync>>,
@@ -46,6 +47,15 @@ impl<T: std::fmt::Display> State<T> {
}
}
impl<T> Clone for State<T> {
fn clone(&self) -> Self {
State {
value: self.value.clone(),
tx: self.tx.clone(),
}
}
}
impl<'a, T> std::ops::Deref for StateGuard<'a, T> {
type Target = T;