pub struct ComponentContainer<Id: Hash + Eq, V> { /* private fields */ }
Implementations§
Source§impl<Id: Hash + Eq + Copy + Debug, V: Clone> ComponentContainer<Id, V>
impl<Id: Hash + Eq + Copy + Debug, V: Clone> ComponentContainer<Id, V>
pub fn new() -> Self
pub fn get_opt(&self, id: Id) -> Option<&V>
pub fn get_opt_mut(&mut self, id: Id) -> Option<&mut V>
Sourcepub fn insert(&mut self, id: Id, data: V)
pub fn insert(&mut self, id: Id, data: V)
Store a given data value under a given entity id of a stupid component if no value is already stored under that entity’s id.
pub fn ids(&self) -> IdIter<'_, Id, V> ⓘ
Sourcepub fn ids_collected(&self) -> Vec<Id>
pub fn ids_collected(&self) -> Vec<Id>
Note: Allocates Vec in heap.
Trait Implementations§
Source§impl<Id: Clone + Hash + Eq, V: Clone> Clone for ComponentContainer<Id, V>
impl<Id: Clone + Hash + Eq, V: Clone> Clone for ComponentContainer<Id, V>
Source§fn clone(&self) -> ComponentContainer<Id, V>
fn clone(&self) -> ComponentContainer<Id, V>
Returns a duplicate 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<Id, V> Freeze for ComponentContainer<Id, V>
impl<Id, V> RefUnwindSafe for ComponentContainer<Id, V>where
Id: RefUnwindSafe,
V: RefUnwindSafe,
impl<Id, V> Send for ComponentContainer<Id, V>
impl<Id, V> Sync for ComponentContainer<Id, V>
impl<Id, V> Unpin for ComponentContainer<Id, V>
impl<Id, V> UnwindSafe for ComponentContainer<Id, V>where
Id: UnwindSafe,
V: 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