[−][src]Struct cranelift_entity::BoxedSlice
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.
Methods
impl<K, V> BoxedSlice<K, V> where
K: EntityRef, [src]
impl<K, V> BoxedSlice<K, V> where
K: EntityRef, pub unsafe fn from_raw(raw: *mut [V]) -> Self | [src] |
Create a new slice from a raw pointer. A safer way to create slices is
to use PrimaryMap::into_boxed_slice().
pub fn is_valid(&self, k: K) -> bool | [src] |
Check if k is a valid key in the map.
pub fn get(&self, k: K) -> Option<&V> | [src] |
Get the element at k if it exists.
pub fn get_mut(&mut self, k: K) -> Option<&mut V> | [src] |
Get the element at k if it exists, mutable version.
pub fn is_empty(&self) -> bool | [src] |
Is this map completely empty?
pub fn len(&self) -> usize | [src] |
Get the total number of entity references created.
ⓘImportant traits for Keys<K>
pub fn keys(&self) -> Keys<K> | [src] |
Iterate over all the keys in this map.
pub fn values(&self) -> Iter<V> | [src] |
Iterate over all the values in this map.
pub fn values_mut(&mut self) -> IterMut<V> | [src] |
Iterate over all the values in this map, mutable edition.
ⓘImportant traits for Iter<'a, K, V>
pub fn iter(&self) -> Iter<K, V> | [src] |
Iterate over all the keys and values in this map.
ⓘImportant traits for IterMut<'a, K, V>
pub fn iter_mut(&mut self) -> IterMut<K, V> | [src] |
Iterate over all the keys and values in this map, mutable edition.
pub fn last(&self) -> Option<&V> | [src] |
Returns the last element that was inserted in the map.
Trait Implementations
impl<K: Debug, V: Debug> Debug for BoxedSlice<K, V> where
K: EntityRef, [src]
impl<K: Debug, V: Debug> Debug for BoxedSlice<K, V> where
K: EntityRef, impl<K, V> Index<K> for BoxedSlice<K, V> where
K: EntityRef, [src]
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.
impl<K, V> IndexMut<K> for BoxedSlice<K, V> where
K: EntityRef, [src]
impl<K, V> IndexMut<K> for BoxedSlice<K, V> where
K: EntityRef, Mutable indexing into a BoxedSlice.
impl<'a, K, V> IntoIterator for &'a BoxedSlice<K, V> where
K: EntityRef, [src]
impl<'a, K, V> IntoIterator for &'a BoxedSlice<K, V> where
K: EntityRef, type Item = (K, &'a V)
The type of the elements being iterated over.
type IntoIter = Iter<'a, K, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter | [src] |
impl<'a, K, V> IntoIterator for &'a mut BoxedSlice<K, V> where
K: EntityRef, [src]
impl<'a, K, V> IntoIterator for &'a mut BoxedSlice<K, V> where
K: EntityRef, type Item = (K, &'a mut V)
The type of the elements being iterated over.
type IntoIter = IterMut<'a, K, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter | [src] |
impl<K: Clone, V: Clone> Clone for BoxedSlice<K, V> where
K: EntityRef, [src]
impl<K: Clone, V: Clone> Clone for BoxedSlice<K, V> where
K: EntityRef, fn clone(&self) -> BoxedSlice<K, V> | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl<K, V> Send for BoxedSlice<K, V> where
K: Send,
V: Send,
impl<K, V> Send for BoxedSlice<K, V> where
K: Send,
V: Send, impl<K, V> Sync for BoxedSlice<K, V> where
K: Sync,
V: Sync,
impl<K, V> Sync for BoxedSlice<K, V> where
K: Sync,
V: Sync, Blanket Implementations
impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> From for T[src]
impl<T> From for Timpl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId | [src] |
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone,