Trait specs::DistinctStorage
[−]
[src]
pub unsafe trait DistinctStorage { }This is a marker trait which requires you to uphold the following guarantee:
Multiple threads may call
get_mut()with distinct indices without causing undefined behavior.
This is for example valid for Vec:
vec![1, 2, 3];
We may modify both element 1 and 2 at the same time; indexing the vector mutably does not modify anything else than the respective elements.
As a counter example, we may have some kind of cached storage; it caches
elements when they're retrieved, so pushes a new element to some cache-vector.
This storage is not allowed to implement DistinctStorage.
Implementing this trait marks the storage safe for concurrent mutation (of distinct
elements), thus allows join_par().
Implementors
impl<T> DistinctStorage for BTreeStorage<T>impl<T> DistinctStorage for HashMapStorage<T>impl<T> DistinctStorage for DenseVecStorage<T>impl<T> DistinctStorage for NullStorage<T>impl<T> DistinctStorage for VecStorage<T>impl<T> DistinctStorage for RudyStorage<T>impl<'a, T: Component, D> DistinctStorage for Storage<'a, T, D> where
T::Storage: DistinctStorage,