Trait storage_api::SharedMutabilityStorage
source · [−]pub unsafe trait SharedMutabilityStorage: Storage {
unsafe fn resolve_raw(
&self,
handle: Self::Handle,
layout: Layout
) -> &mut Memory;
}
Expand description
A storage that serves as a uniqueness barrier.
Notably, this means that this storage can go &Storage -> &mut Memory
, and
thus it is possible to mutate the stored memory behind a shared storage
reference, and to mutably resolve multiple handles separately without
invalidating previously resolved handles.
Required Methods
unsafe fn resolve_raw(
&self,
handle: Self::Handle,
layout: Layout
) -> &mut Memory
unsafe fn resolve_raw(
&self,
handle: Self::Handle,
layout: Layout
) -> &mut Memory
Resolve a memory handle in this storage to a mutable reference.
Safety
- The handle must have been created by this storage, and must not have been invalidated.
- The layout must be the same as used to allocate the handle.