collections::vec::Drain - Rust
Description: API documentation for the Rust `Drain` struct in crate `collections`.
Keywords: rust, rustlang, rust-lang, Drain

# Struct collections::vec::Drain 1.6.0 [−] [src]

    pub struct Drain<'a, T> where
        T: 'a,  { /* fields omitted */ }

A draining iterator for `Vec<T>`.

This `struct` is created by the `drain` method on `Vec`.

## Trait Implementations

### `impl<'a, T> ExactSizeIterator for Drain<'a, T>`
[src]

#### `fn is_empty(&self) -> bool`
[src]

### `impl<'a, T> FusedIterator for Drain<'a, T>`
[src]

### `impl<'a, T> DoubleEndedIterator for Drain<'a, T>`
[src]

#### `fn next_back(&mut self) -> Option<T>`
[src]

### `impl<'a, T> Debug for Drain<'a, T> where
T: 'a + Debug,`
1.17.0
[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result<(), Error>`
[src]

Formats the value using the given formatter.

### `impl<'a, T> Sync for Drain<'a, T> where
T: Sync,`
[src]

### `impl<'a, T> Iterator for Drain<'a, T>`
[src]

#### `type Item = T`

#### `fn next(&mut self) -> Option<T>`
[src]

#### `fn size_hint(&self) -> (usize, Option<usize>)`
[src]

### `impl<'a, T> Drop for Drain<'a, T>`
[src]

#### `fn drop(&mut self)`
[src]

### `impl<'a, T> Send for Drain<'a, T> where
T: Send,`
[src]

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)