[][src]Trait specs::storage::DistinctStorage

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<'a> DistinctStorage for AntiStorage<'a>[src]

impl<'a, T: Component, D> DistinctStorage for Storage<'a, T, D> where
    T::Storage: DistinctStorage
[src]

impl<T> DistinctStorage for BTreeStorage<T>[src]

impl<T> DistinctStorage for DenseVecStorage<T>[src]

impl<T> DistinctStorage for HashMapStorage<T>[src]

impl<T> DistinctStorage for NullStorage<T>[src]

This is safe because you cannot mutate ZSTs.

impl<T> DistinctStorage for VecStorage<T>[src]

Loading content...