pub struct HashMapStore<A: Agent> { /* private fields */ }Expand description
Hash-map-based agent store.
Backed by hashbrown::HashMap for O(1) average-case insert, remove,
and lookup. Iteration order is not guaranteed and must not be used as a
reproducibility contract.
This is the default store for most simulations.
Implementations§
Trait Implementations§
Source§impl<A: Agent> AgentStore<A> for HashMapStore<A>
impl<A: Agent> AgentStore<A> for HashMapStore<A>
Source§fn get_mut(&self, id: AgentId) -> Option<RefMut<'_, A>>
fn get_mut(&self, id: AgentId) -> Option<RefMut<'_, A>>
Borrow an agent mutably by ID. Read more
Source§fn remove(&mut self, id: AgentId) -> Option<A>
fn remove(&mut self, id: AgentId) -> Option<A>
Remove and return an agent by ID, or
None if not found.Auto Trait Implementations§
impl<A> Freeze for HashMapStore<A>
impl<A> !RefUnwindSafe for HashMapStore<A>
impl<A> Send for HashMapStore<A>where
A: Send,
impl<A> !Sync for HashMapStore<A>
impl<A> Unpin for HashMapStore<A>where
A: Unpin,
impl<A> UnsafeUnpin for HashMapStore<A>
impl<A> UnwindSafe for HashMapStore<A>where
A: UnwindSafe,
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