Struct sync42::state_hash_table::StateHashTable
source · pub struct StateHashTable<K: Key, V: Value> { /* private fields */ }
Expand description
StateHashTable is the main collection.
Implementations§
source§impl<K: Key, V: Value> StateHashTable<K, V>
impl<K: Key, V: Value> StateHashTable<K, V>
sourcepub fn create_state<'a: 'b, 'b>(&'a self, key: K) -> Option<Handle<'a, K, V>>where
V: From<K>,
pub fn create_state<'a: 'b, 'b>(&'a self, key: K) -> Option<Handle<'a, K, V>>where
V: From<K>,
Create a new piece of state, returning None iff there already exists state for key
.
sourcepub fn get_state<'a: 'b, 'b>(&'a self, key: K) -> Option<Handle<'b, K, V>>
pub fn get_state<'a: 'b, 'b>(&'a self, key: K) -> Option<Handle<'b, K, V>>
Return an existing new piece of state, returning None iff there does not exist state for
key
.
sourcepub fn get_or_create_state<'a: 'b, 'b>(&'a self, key: K) -> Handle<'b, K, V>where
V: From<K>,
pub fn get_or_create_state<'a: 'b, 'b>(&'a self, key: K) -> Handle<'b, K, V>where
V: From<K>,
Return an existing piece of state, or create a new one, and always return a handle to the
state for key
.
Trait Implementations§
Auto Trait Implementations§
impl<K, V> RefUnwindSafe for StateHashTable<K, V>
impl<K, V> Send for StateHashTable<K, V>
impl<K, V> Sync for StateHashTable<K, V>
impl<K, V> Unpin for StateHashTable<K, V>where
K: Unpin,
impl<K, V> UnwindSafe for StateHashTable<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