Struct wasmer_types::entity::BoxedSlice
source · pub struct BoxedSlice<K, V>where
K: EntityRef,{ /* private fields */ }
Expand description
A slice mapping K -> V
allocating dense entity references.
The BoxedSlice
data structure uses the dense index space to implement a map with a boxed
slice.
Implementations§
source§impl<K, V> BoxedSlice<K, V>where
K: EntityRef,
impl<K, V> BoxedSlice<K, V>where
K: EntityRef,
sourcepub unsafe fn from_raw(raw: *mut [V]) -> Self
pub unsafe fn from_raw(raw: *mut [V]) -> Self
Create a new slice from a raw pointer. A safer way to create slices is
to use PrimaryMap::into_boxed_slice()
.
§Safety
This relies on raw
pointing to a valid slice of V
s.
sourcepub fn get_mut(&mut self, k: K) -> Option<&mut V>
pub fn get_mut(&mut self, k: K) -> Option<&mut V>
Get the element at k
if it exists, mutable version.
sourcepub fn values_mut(&mut self) -> IterMut<'_, V> ⓘ
pub fn values_mut(&mut self) -> IterMut<'_, V> ⓘ
Iterate over all the values in this map, mutable edition.
Trait Implementations§
source§impl<K, V: Clone> Clone for BoxedSlice<K, V>
impl<K, V: Clone> Clone for BoxedSlice<K, V>
source§fn clone(&self) -> BoxedSlice<K, V>
fn clone(&self) -> BoxedSlice<K, V>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<K, V: Debug> Debug for BoxedSlice<K, V>
impl<K, V: Debug> Debug for BoxedSlice<K, V>
source§impl<K, V> Index<K> for BoxedSlice<K, V>where
K: EntityRef,
impl<K, V> Index<K> for BoxedSlice<K, V>where
K: EntityRef,
Immutable indexing into a BoxedSlice
.
The indexed value must be in the map.
source§impl<K, V> IndexMut<K> for BoxedSlice<K, V>where
K: EntityRef,
impl<K, V> IndexMut<K> for BoxedSlice<K, V>where
K: EntityRef,
Mutable indexing into a BoxedSlice
.
source§impl<'a, K, V> IntoIterator for &'a BoxedSlice<K, V>where
K: EntityRef,
impl<'a, K, V> IntoIterator for &'a BoxedSlice<K, V>where
K: EntityRef,
source§impl<'a, K, V> IntoIterator for &'a mut BoxedSlice<K, V>where
K: EntityRef,
impl<'a, K, V> IntoIterator for &'a mut BoxedSlice<K, V>where
K: EntityRef,
Auto Trait Implementations§
impl<K, V> Freeze for BoxedSlice<K, V>
impl<K, V> RefUnwindSafe for BoxedSlice<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for BoxedSlice<K, V>
impl<K, V> Sync for BoxedSlice<K, V>
impl<K, V> Unpin for BoxedSlice<K, V>where
K: Unpin,
impl<K, V> UnwindSafe for BoxedSlice<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.