pub type JumpTables = PrimaryMap<JumpTable, JumpTableData>;
Expand description
Map of jump tables.
Aliased Type§
struct JumpTables { /* private fields */ }
Implementations
§impl<K, V> PrimaryMap<K, V>where
K: EntityRef,
impl<K, V> PrimaryMap<K, V>where
K: EntityRef,
pub fn new() -> PrimaryMap<K, V>
pub fn new() -> PrimaryMap<K, V>
Create a new empty map.
pub fn with_capacity(capacity: usize) -> PrimaryMap<K, V>
pub fn with_capacity(capacity: usize) -> PrimaryMap<K, V>
Create a new empty map with the given capacity.
pub 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.
pub fn keys(&self) -> Keys<K>
pub fn keys(&self) -> Keys<K>
Iterate over all the keys in this map.
pub 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.
pub fn iter(&self) -> Iter<'_, K, V>
pub fn iter(&self) -> Iter<'_, K, V>
Iterate over all the keys and values in this map.
pub fn iter_mut(&mut self) -> IterMut<'_, K, V>
pub fn iter_mut(&mut self) -> IterMut<'_, K, V>
Iterate over all the keys and values in this map, mutable edition.
pub fn clear(&mut self)
pub fn clear(&mut self)
Remove all entries from this map.
pub fn next_key(&self) -> K
pub fn next_key(&self) -> K
Get the key that will be assigned to the next pushed value.
pub fn push(&mut self, v: V) -> K
pub fn push(&mut self, v: V) -> K
Append v
to the mapping, assigning a new key which is returned.
pub fn last_mut(&mut self) -> Option<(K, &mut V)>
pub fn last_mut(&mut self) -> Option<(K, &mut V)>
Returns the last element that was inserted in the map.
pub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional
more elements to be inserted.
pub fn reserve_exact(&mut self, additional: usize)
pub fn reserve_exact(&mut self, additional: usize)
Reserves the minimum capacity for exactly additional
more elements to be inserted.
pub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the PrimaryMap
as much as possible.
pub fn into_boxed_slice(self) -> BoxedSlice<K, V>
pub fn into_boxed_slice(self) -> BoxedSlice<K, V>
Consumes this PrimaryMap
and produces a BoxedSlice
.
pub fn get_many_mut<const N: usize>(
&mut self,
indices: [K; N],
) -> Result<[&mut V; N], GetManyMutError<K>>
pub fn get_many_mut<const N: usize>( &mut self, indices: [K; N], ) -> Result<[&mut V; N], GetManyMutError<K>>
Returns mutable references to many elements at once.
Returns an error if an element does not exist, or if the same key was passed more than once.
pub fn binary_search_values_by_key<'a, B, F>(
&'a self,
b: &B,
f: F,
) -> Result<K, K>
pub fn binary_search_values_by_key<'a, B, F>( &'a self, b: &B, f: F, ) -> Result<K, K>
Performs a binary search on the values with a key extraction function.
Assumes that the values are sorted by the key extracted by the function.
If the value is found then Ok(K)
is returned, containing the entity key
of the matching value.
If there are multiple matches, then any one of the matches could be returned.
If the value is not found then Err(K) is returned, containing the entity key where a matching element could be inserted while maintaining sorted order.
pub fn get_raw_mut(&mut self, k: K) -> Option<*mut V>
pub fn get_raw_mut(&mut self, k: K) -> Option<*mut V>
Analog of get_raw
except that a raw pointer is returned rather than a
mutable reference.
The default accessors of items in [PrimaryMap
] will invalidate all
previous borrows obtained from the map according to miri. This function
can be used to acquire a pointer and then subsequently acquire a second
pointer later on without invalidating the first one. In other words
this is only here to help borrow two elements simultaneously with miri.
Trait Implementations
§impl<'de, K, V> Deserialize<'de> for PrimaryMap<K, V>where
K: EntityRef,
V: Deserialize<'de>,
impl<'de, K, V> Deserialize<'de> for PrimaryMap<K, V>where
K: EntityRef,
V: Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PrimaryMap<K, V>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PrimaryMap<K, V>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl<K, V> FromIterator<V> for PrimaryMap<K, V>where
K: EntityRef,
impl<K, V> FromIterator<V> for PrimaryMap<K, V>where
K: EntityRef,
§fn from_iter<T>(iter: T) -> PrimaryMap<K, V>where
T: IntoIterator<Item = V>,
fn from_iter<T>(iter: T) -> PrimaryMap<K, V>where
T: IntoIterator<Item = V>,
§impl<K, V> Index<K> for PrimaryMap<K, V>where
K: EntityRef,
Immutable indexing into an PrimaryMap
.
The indexed value must be in the map.
impl<K, V> Index<K> for PrimaryMap<K, V>where
K: EntityRef,
Immutable indexing into an PrimaryMap
.
The indexed value must be in the map.