Struct anchor_chain::StateManager
source · pub struct StateManager<K, V> { /* private fields */ }Implementations§
source§impl<K: Eq + Hash + Clone, V: Clone> StateManager<K, V>
impl<K: Eq + Hash + Clone, V: Clone> StateManager<K, V>
pub fn new() -> Self
pub async fn get(&self, key: &K) -> Option<V>
pub async fn insert(&self, key: K, value: V)
pub async fn remove(&self, key: &K) -> Option<V>
pub async fn len(&self) -> usize
pub async fn is_empty(&self) -> bool
pub async fn clear(&self)
pub async fn contains_key(&self, key: &K) -> bool
pub async fn keys(&self) -> Vec<K>
pub async fn values(&self) -> Vec<V>
pub async fn read(&self) -> RwLockReadGuard<'_, HashMap<K, V>>
pub async fn write(&self) -> RwLockWriteGuard<'_, HashMap<K, V>>
Trait Implementations§
source§impl<K: Clone, V: Clone> Clone for StateManager<K, V>
impl<K: Clone, V: Clone> Clone for StateManager<K, V>
source§fn clone(&self) -> StateManager<K, V>
fn clone(&self) -> StateManager<K, V>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<K, V> Freeze for StateManager<K, V>
impl<K, V> !RefUnwindSafe for StateManager<K, V>
impl<K, V> Send for StateManager<K, V>
impl<K, V> Sync for StateManager<K, V>
impl<K, V> Unpin for StateManager<K, V>
impl<K, V> !UnwindSafe for StateManager<K, V>
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