pub fn drain(&mut self) -> Drain<K, V> {
        Drain {
            cur: unsafe { self.slots.get_unchecked(0).u.free.other_end as usize + 1 },
            sm: self,
        }
    }
/// Clears the slot map, returning all key-value pairs in arbitrary order as
/// an iterator. Keeps the allocated memory for reuse.
///
/// When the iterator is dropped all elements in the slot map are removed,
/// even if the iterator was not fully consumed. If the iterator is not
/// dropped (using e.g. [`std::mem::forget`]), only the elements that were
/// iterated over are removed.
///
/// # Examples
///
/// ```
/// # use slotmap::*;
/// let mut sm = HopSlotMap::new();
/// let k = sm.insert(0);
/// let v: Vec<_> = sm.drain().collect();
/// assert_eq!(sm.len(), 0);
/// assert_eq!(v, vec![(k, 0)]);
/// ```
Clears the slot map, returning all key-value pairs in arbitrary order as
an iterator. Keeps the allocated memory for reuse.

When the iterator is dropped all elements in the slot map are removed,
even if the iterator was not fully consumed. If the iterator is not
dropped (using e.g. [`std::mem::forget`]), only the elements that were
iterated over are removed.
Clears the slot map returning all key - value pairs in arbitrary order as an iterator . Keeps the allocated memory for reuse . When the iterator is dropped all elements in the slot map are removed even if the iterator was not fully consumed . If the iterator is not dropped ( using e . g . [ ` std :: mem :: forget ` ] ) only the elements that were iterated over are removed .
pub fn drain(&mut self) -> Drain<K, V> {
        Drain {
            cur: unsafe { self.slots.get_unchecked(0).u.free.other_end as usize + 1 },
            sm: self,
        }
    }
pub fn drain ( & mut self ) -> Drain < K , V > { Drain { cur : unsafe { self . slots . get_unchecked ( 0 ) . u . free . other_end as usize + 1 } , sm : self , } }
Clears the slot map, returning all key-value pairs in arbitrary order as
an iterator.
Clears the slot map returning all key - value pairs in arbitrary order as an iterator .
&mut self
examples
None
use slotmap::*;
None