Module collections::vec_deque [] [src]

VecDeque is a double-ended queue, which is implemented with the help of a growing ring buffer.

This queue has O(1) amortized inserts and removals from both ends of the container. It also has O(1) indexing like a vector. The contained elements are not required to be copyable, and the queue will be sendable if the contained type is sendable.

Reexports

use core::prelude::v1::*;
use core::cmp::Ordering;
use core::fmt;
use core::iter::{repeat, FromIterator};
use core::mem;
use core::ops::{Index, IndexMut};
use core::ptr;
use core::slice;
use core::hash::{Hash, Hasher};
use core::cmp;
use alloc::raw_vec::RawVec;
use super::range::RangeArgument;

Structs

Drain

A draining VecDeque iterator

IntoIter

A by-value VecDeque iterator

Iter

VecDeque iterator.

IterMut

VecDeque mutable iterator.

VecDeque

VecDeque is a growable ring buffer, which can be used as a double-ended queue efficiently.

Constants

INITIAL_CAPACITY
MAXIMUM_ZST_CAPACITY
MINIMUM_CAPACITY

Functions

count

Calculate the number of elements left to be read in the buffer

wrap_index

Returns the index in the underlying buffer for a given logical element index.