[][src]Struct slab::Entry

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][]

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

Auto Trait Implementations

impl<'a, T, I> RefUnwindSafe for Entry<'a, T, I> where
    I: RefUnwindSafe,
    T: RefUnwindSafe

impl<'a, T, I> Send for Entry<'a, T, I> where
    T: Send

impl<'a, T, I> Sync for Entry<'a, T, I> where
    I: Sync,
    T: Sync

impl<'a, T, I> Unpin for Entry<'a, T, I>

impl<'a, T, I> !UnwindSafe for Entry<'a, T, I>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src][+]

impl<T> Borrow<T> for T where
    T: ?Sized
[src][+]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src][+]

impl<T> From<T> for T[src][+]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src][+]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src][+]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src][+]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.