pub fn drain(&mut self) -> Drain<EntryData> {
        Drain {
            head: self.head(),
            remaining: self.length,
            tail: self.tail(),
            list: self,
        }
    }
/// Creates a draining iterator that removes all values from the list and yields them in order.
///
/// All values are removed even if the iterator is only partially consumed or not consumed at
/// all.
///
/// # Examples
///
/// ```
/// use dlv_list::VecList;
///
/// let mut list = VecList::new();
/// list.push_back(0);
/// list.push_back(5);
///
/// {
///     let mut iter = list.drain();
///     assert_eq!(iter.next(), Some(0));
///     assert_eq!(iter.next(), Some(5));
///     assert_eq!(iter.next(), None);
/// }
///
/// println!("{}", list.len());
/// assert!(list.is_empty());
/// ```
Creates a draining iterator that removes all values from the list and yields them in order.
All values are removed even if the iterator is only partially consumed or not consumed at
all.
Creates a draining iterator that removes all values from the list and yields them in order . All values are removed even if the iterator is only partially consumed or not consumed at all .
pub fn drain(&mut self) -> Drain<EntryData> {
        Drain {
            head: self.head(),
            remaining: self.length,
            tail: self.tail(),
            list: self,
        }
    }
pub fn drain ( & mut self ) -> Drain < EntryData > { Drain { head : self . head ( ) , remaining : self . length , tail : self . tail ( ) , list : self , } }
Creates a draining iterator that removes all values from the list and yields them in order.
Creates a draining iterator that removes all values from the list and yields them in order .
&mut self
&mut self
examples
```
use dlv_list::VecList.



{
let mut iter = list.drain();
assert_eq!(iter.next(), Some(0));
assert_eq!(iter.next(), Some(5));
assert_eq!(iter.next(), None);
}


` ` ` use dlv_list :: VecList . { let mut iter = list . drain () ; assert_eq! ( iter . next () Some ( 0 )) ; assert_eq! ( iter . next () Some ( 5 )) ; assert_eq! ( iter . next () None ) ; }