Command Input
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user