diff --git a/pulse-ui/src/StateManagement.mist b/pulse-ui/src/StateManagement.mist new file mode 100644 index 0000000..603a50d --- /dev/null +++ b/pulse-ui/src/StateManagement.mist @@ -0,0 +1,25 @@ +pub module state_management; + +use std::sync::Arc; +use std::sync::Mutex; +use std::sync::LockResult; +use std::sync::MutexGuard; + +pub trait Dependent +{ + void update(&self); +} + +pub struct State +{ + pub Box dependent; + pub Arc> data; +} + +impl State +{ + LockResult> lock(&self) + { + self.data.lock() + } +}