Struct rex::storage::StateStore
source · pub struct StateStore<Id, S> {
pub trees: DashMap<Id, Arc<FairMutex<Node<Id, S>>>>,
}Expand description
StateStore is the storage layer for all state machines associated with a given manager.
Every state tree is associated with a particular Mutex
this allows separate state hirearchies to be acted upon concurrently
while making operations in a particular tree blocking
Fields§
§trees: DashMap<Id, Arc<FairMutex<Node<Id, S>>>>Implementations§
source§impl<K: Rex> StateStore<StateId<K>, K::State>
impl<K: Rex> StateStore<StateId<K>, K::State>
pub fn new() -> Self
pub fn new_tree( node: Node<StateId<K>, K::State> ) -> Arc<FairMutex<Node<StateId<K>, <K as Kind>::State>>>
pub fn insert_ref( &self, id: StateId<K>, node: Arc<FairMutex<Node<StateId<K>, <K as Kind>::State>>> )
pub fn remove_ref(&self, id: StateId<K>)
pub fn get_tree( &self, id: StateId<K> ) -> Option<Arc<FairMutex<Node<StateId<K>, <K as Kind>::State>>>>
Trait Implementations§
Auto Trait Implementations§
impl<Id, S> !RefUnwindSafe for StateStore<Id, S>
impl<Id, S> Send for StateStore<Id, S>
impl<Id, S> Sync for StateStore<Id, S>
impl<Id, S> Unpin for StateStore<Id, S>
impl<Id, S> !UnwindSafe for StateStore<Id, S>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more