Struct slab::Entry
[−]
[src]
pub struct Entry<'a, T: 'a, I: 'a> { /* fields omitted */ }
A handle to an occupied slot in the Slab
Methods
impl<'a, T, I: From<usize> + Into<usize>> Entry<'a, T, I>
[src]
fn replace(&mut self, val: T) -> T
Replace the value stored in the entry
fn replace_with<F>(&mut self, f: F) where F: FnOnce(T) -> T
Apply the function to the current value, replacing it with the result of the function.
fn remove(self) -> T
Remove and return the value stored in the entry
fn get(&self) -> &T
Get a reference to the value stored in the entry
fn get_mut(&mut self) -> &mut T
Get a mutable reference to the value stored in the entry
fn into_mut(self) -> &'a mut T
Convert the entry handle to a mutable reference
fn index(&self) -> I
Return the entry index