pub struct EntityMap<I: EntityId, K: Hash + Eq, V, RS: BuildHasher = RandomState> { /* private fields */ }Expand description
Implementations§
Source§impl<I, K, V, RS> EntityMap<I, K, V, RS>
impl<I, K, V, RS> EntityMap<I, K, V, RS>
pub fn with_hasher(h: RS) -> Self
pub fn with_capacity_and_hasher(n: usize, h: RS) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn next_id(&self) -> I
pub fn clear(&mut self)
pub fn insert(&mut self, k: K, v: V) -> (I, Option<V>)
pub fn insert_new(&mut self, k: K, v: V) -> I
pub fn key(&self, id: I) -> &K
pub fn get<Q>(&self, key: &Q) -> Option<(I, &V)>
pub fn get_mut<Q>(&mut self, key: &Q) -> Option<(I, &mut V)>
pub fn get_full<Q>(&self, key: &Q) -> Option<(I, &K, &V)>
pub fn get_full_mut<Q>(&mut self, key: &Q) -> Option<(I, &K, &mut V)>
pub fn entry(&mut self, key: K) -> Entry<'_, I, K, V>
pub fn contains_key<Q>(&self, key: &Q) -> bool
pub fn ids(&self) -> EntityRange<I>
pub fn iter(&self) -> Iter<'_, I, K, V> ⓘ
pub fn iter_mut(&mut self) -> IterMut<'_, I, K, V> ⓘ
pub fn keys(&self) -> Keys<'_, K, V> ⓘ
pub fn into_keys(self) -> IntoKeys<K, V> ⓘ
pub fn values(&self) -> Values<'_, K, V> ⓘ
pub fn values_mut(&mut self) -> ValuesMut<'_, K, V> ⓘ
pub fn into_values(self) -> IntoValues<K, V> ⓘ
pub fn into_vec(self) -> EntityVec<I, (K, V)>
Trait Implementations§
Source§impl<I: Clone + EntityId, K: Clone + Hash + Eq, V: Clone, RS: Clone + BuildHasher> Clone for EntityMap<I, K, V, RS>
impl<I: Clone + EntityId, K: Clone + Hash + Eq, V: Clone, RS: Clone + BuildHasher> Clone for EntityMap<I, K, V, RS>
impl<I, K, V, RS> Eq for EntityMap<I, K, V, RS>
Source§impl<I, K, V, RS> Extend<(K, V)> for EntityMap<I, K, V, RS>
impl<I, K, V, RS> Extend<(K, V)> for EntityMap<I, K, V, RS>
Source§fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<I, K, V, RS> FromIterator<(K, V)> for EntityMap<I, K, V, RS>
impl<I, K, V, RS> FromIterator<(K, V)> for EntityMap<I, K, V, RS>
Source§impl<I, K, V, RS> IntoIterator for EntityMap<I, K, V, RS>
impl<I, K, V, RS> IntoIterator for EntityMap<I, K, V, RS>
Source§impl<'a, I, K, V, RS> IntoIterator for &'a EntityMap<I, K, V, RS>
impl<'a, I, K, V, RS> IntoIterator for &'a EntityMap<I, K, V, RS>
Source§impl<'a, I, K, V, RS> IntoIterator for &'a mut EntityMap<I, K, V, RS>
impl<'a, I, K, V, RS> IntoIterator for &'a mut EntityMap<I, K, V, RS>
Auto Trait Implementations§
impl<I, K, V, RS> Freeze for EntityMap<I, K, V, RS>where
RS: Freeze,
impl<I, K, V, RS> RefUnwindSafe for EntityMap<I, K, V, RS>
impl<I, K, V, RS> Send for EntityMap<I, K, V, RS>
impl<I, K, V, RS> Sync for EntityMap<I, K, V, RS>
impl<I, K, V, RS> Unpin for EntityMap<I, K, V, RS>
impl<I, K, V, RS> UnsafeUnpin for EntityMap<I, K, V, RS>where
RS: UnsafeUnpin,
impl<I, K, V, RS> UnwindSafe for EntityMap<I, K, V, RS>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.