Struct wasmer_types::entity::SecondaryMap [−][src]
Expand description
A mapping K -> V
for densely indexed entity references.
The SecondaryMap
data structure uses the dense index space to implement a map with a vector.
Unlike PrimaryMap
, an SecondaryMap
can’t be used to allocate entity references. It is used
to associate secondary information with entities.
The map does not track if an entry for a key has been inserted or not. Instead it behaves as if all keys have a default entry from the beginning.
Implementations
Shared SecondaryMap
implementation for all value types.
Create a new, empty map with the specified capacity.
The map will be able to hold exactly capacity
elements without reallocating.
Create a new empty map with a specified default value.
This constructor does not require V to implement Default.
Returns the number of elements the map can hold without reallocating.
Iterate over all the keys and values in this map.
Iterate over all the keys and values in this map, mutable edition.
Iterate over all the keys in this map.
Iterate over all the values in this map.
Iterate over all the values in this map, mutable edition.
Trait Implementations
impl<K, V> Archive for SecondaryMap<K, V> where
K: EntityRef,
V: Clone,
Vec<V>: Archive,
V: Archive,
PhantomData<K>: Archive,
[src]
impl<K, V> Archive for SecondaryMap<K, V> where
K: EntityRef,
V: Clone,
Vec<V>: Archive,
V: Archive,
PhantomData<K>: Archive,
[src]Returns the “default value” for a type. Read more
impl<'de, K, V> Deserialize<'de> for SecondaryMap<K, V> where
K: EntityRef,
V: Clone + Deserialize<'de>,
[src]
impl<'de, K, V> Deserialize<'de> for SecondaryMap<K, V> where
K: EntityRef,
V: Clone + Deserialize<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl<__D: Fallible + ?Sized, K, V> Deserialize<SecondaryMap<K, V>, __D> for Archived<SecondaryMap<K, V>> where
K: EntityRef,
V: Clone,
Vec<V>: Archive,
Archived<Vec<V>>: Deserialize<Vec<V>, __D>,
V: Archive,
Archived<V>: Deserialize<V, __D>,
PhantomData<K>: Archive,
Archived<PhantomData<K>>: Deserialize<PhantomData<K>, __D>,
[src]
impl<__D: Fallible + ?Sized, K, V> Deserialize<SecondaryMap<K, V>, __D> for Archived<SecondaryMap<K, V>> where
K: EntityRef,
V: Clone,
Vec<V>: Archive,
Archived<Vec<V>>: Deserialize<Vec<V>, __D>,
V: Archive,
Archived<V>: Deserialize<V, __D>,
PhantomData<K>: Archive,
Archived<PhantomData<K>>: Deserialize<PhantomData<K>, __D>,
[src]Deserializes using the given deserializer
Immutable indexing into an SecondaryMap
.
All keys are permitted. Untouched entries have the default value.
Mutable indexing into an SecondaryMap
.
The map grows as needed to accommodate new keys.
Returns the size of the referenced value in bytes. Read more
impl<K, V> PartialEq<SecondaryMap<K, V>> for SecondaryMap<K, V> where
K: EntityRef,
V: Clone + PartialEq,
[src]
impl<K, V> PartialEq<SecondaryMap<K, V>> for SecondaryMap<K, V> where
K: EntityRef,
V: Clone + PartialEq,
[src]Auto Trait Implementations
impl<K, V> RefUnwindSafe for SecondaryMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for SecondaryMap<K, V> where
K: Send,
V: Send,
impl<K, V> Sync for SecondaryMap<K, V> where
K: Sync,
V: Sync,
impl<K, V> Unpin for SecondaryMap<K, V> where
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for SecondaryMap<K, V> where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Converts some archived metadata to the pointer metadata for itself.
The archived counterpart of this type. Unlike Archive
, it may be unsized.
type MetadataResolver = ()
type MetadataResolver = ()
The resolver for the metadata of this type.
pub fn resolve_metadata(
&self,
usize,
<T as ArchiveUnsized>::MetadataResolver,
&mut MaybeUninit<<<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata>
)
[src]
pub fn resolve_metadata(
&self,
usize,
<T as ArchiveUnsized>::MetadataResolver,
&mut MaybeUninit<<<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata>
)
[src]Creates the archived version of the metadata for this value at the given position and writes it to the given output. Read more
fn resolve_unsized(
&self,
from: usize,
to: usize,
resolver: Self::MetadataResolver,
out: &mut MaybeUninit<RelPtr<Self::Archived>>
)
[src]
fn resolve_unsized(
&self,
from: usize,
to: usize,
resolver: Self::MetadataResolver,
out: &mut MaybeUninit<RelPtr<Self::Archived>>
)
[src]Resolves a relative pointer to this value with the given from
and to
and writes it to
the given output. Read more
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Writes the object and returns the position of the archived type.
pub fn serialize_metadata(
&self,
&mut S
) -> Result<<<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, <S as Fallible>::Error>
[src]
pub fn serialize_metadata(
&self,
&mut S
) -> Result<<<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, <S as Fallible>::Error>
[src]Serializes the metadata for the given type.