pub struct SliceMap<K, V, S>{ /* private fields */ }Expand description
This generic SliceMap needs to be provided a Key type, a Value type and a Storage type. Use SlotSliceMap and SecSliceMap for storage using SlotMap and SecondarySlotMap, respectively.
Implementations§
Source§impl<K, V, S> SliceMap<K, V, S>
impl<K, V, S> SliceMap<K, V, S>
Sourcepub fn with_capacity(cap: usize) -> Self
pub fn with_capacity(cap: usize) -> Self
Returns a new SliceMap with the specified initial capacity.
Sourcepub fn slices_len(&self) -> usize
pub fn slices_len(&self) -> usize
How many slices are contained in the SliceMap.
Sourcepub fn iter_slices(&self) -> SliceIter<'_, K, V, S> ⓘ
pub fn iter_slices(&self) -> SliceIter<'_, K, V, S> ⓘ
Returns an iterator for slices of items.
Sourcepub fn iter_keys_and_slices(&self) -> KeySliceIter<'_, K, V, S> ⓘ
pub fn iter_keys_and_slices(&self) -> KeySliceIter<'_, K, V, S> ⓘ
Returns an iterator for slices of items along with their keys.
Sourcepub fn iter_items(&self) -> impl Iterator<Item = &V>
pub fn iter_items(&self) -> impl Iterator<Item = &V>
Returns an iterator for each individual item.
Sourcepub fn remove_slice(&mut self, key: K) -> Option<Range<u32>>
pub fn remove_slice(&mut self, key: K) -> Option<Range<u32>>
Removes a slice by key. Warning: Will cause all items to “shift” to occupy the removed space, and all slices will be updated with the new indices.
Trait Implementations§
Auto Trait Implementations§
impl<K, V, S> Freeze for SliceMap<K, V, S>where
S: Freeze,
impl<K, V, S> RefUnwindSafe for SliceMap<K, V, S>
impl<K, V, S> Send for SliceMap<K, V, S>
impl<K, V, S> Sync for SliceMap<K, V, S>
impl<K, V, S> Unpin for SliceMap<K, V, S>
impl<K, V, S> UnwindSafe for SliceMap<K, V, S>
Blanket Implementations§
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