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]
pub fn replace(&mut self, val: T) -> T
[src]
Replace the value stored in the entry
pub fn replace_with<F>(&mut self, f: F) where
F: FnOnce(T) -> T,
[src]
F: FnOnce(T) -> T,
Apply the function to the current value, replacing it with the result of the function.
pub fn remove(self) -> T
[src]
Remove and return the value stored in the entry
pub fn get(&self) -> &T
[src]
Get a reference to the value stored in the entry
pub fn get_mut(&mut self) -> &mut T
[src]
Get a mutable reference to the value stored in the entry
pub fn into_mut(self) -> &'a mut T
[src]
Convert the entry handle to a mutable reference
pub fn index(&self) -> I
[src]
Return the entry index