pub fn drain(&mut self) -> Drain<T> {
        let mut iter = self.slabs.iter_mut();
        let draining = iter.next().unwrap().drain();
        Drain { iter, draining }
    }
/// Return a draining iterator that removes all elements from the slab and
/// yields the removed items.
///
/// Note: Elements are removed even if the iterator is only partially
/// consumed or not consumed at all.
///
/// # Examples
///
/// ```
/// # use super_slab::*;
/// let mut slab = SuperSlab::new();
///
/// let _ = slab.insert(0);
/// let _ = slab.insert(1);
/// let _ = slab.insert(2);
///
/// {
///     let mut drain = slab.drain();
///
///     assert_eq!(Some(0), drain.next());
///     assert_eq!(Some(1), drain.next());
///     assert_eq!(Some(2), drain.next());
///     assert_eq!(None, drain.next());
/// }
///
/// assert!(slab.is_empty());
/// ```
Return a draining iterator that removes all elements from the slab and
yields the removed items.

Elements are removed even if the iterator is only partially
consumed or not consumed at all.
Return a draining iterator that removes all elements from the slab and yields the removed items . Elements are removed even if the iterator is only partially consumed or not consumed at all .
pub fn drain(&mut self) -> Drain<T> {
        let mut iter = self.slabs.iter_mut();
        let draining = iter.next().unwrap().drain();
        Drain { iter, draining }
    }
pub fn drain ( & mut self ) -> Drain < T > { let mut iter = self . slabs . iter_mut ( ) ; let draining = iter . next ( ) . unwrap ( ) . drain ( ) ; Drain { iter , draining } }
Return a draining iterator that removes all elements from the slab and
yields the removed items.
Return a draining iterator that removes all elements from the slab and yields the removed items .
&mut self
&mut self
examples
None
use super_slab::*;
let mut slab = SuperSlab::new().

let _ = slab.insert(0);
let _ = slab.insert(1);
let _ = slab.insert(2).

{
let mut drain = slab.drain().




let mut slab = SuperSlab :: new () . let _ = slab . insert ( 0 ) ; let _ = slab . insert ( 1 ) ; let _ = slab . insert ( 2 ) . { let mut drain = slab . drain () .