Trait storage_api::MultipleStorage
source · [−]pub unsafe trait MultipleStorage: Storage {
unsafe fn resolve_many_mut<const N: usize>(
&mut self,
handles: [(Self::Handle, Layout); N]
) -> [&mut Memory; N];
}
Expand description
A storage that can manage multiple memory handles.
allocate
no longer invalidates existing handles. You can allocate
multiple handles that are all valid at the same time. This does not change
the requirements of resolve
or resolve_mut
; only one pointer
returned from resolve_mut
is valid at a time.
In addition, grow
and shrink
are implemented at least at least as
well as creating a new handle and copying over the old contents. (This is
provided by default impl.)
Required Methods
Resolve memory handles in this storage to mutable references.
Safety
- The handles 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.
- The same handle must not be resolved twice in a single call.