ring_queue 
A double-ended queue implemented using a Vec that reuses space after
elements are removed.
The API is heavily based on collections.deque from Python.
You can create a ring using any of the available constructors or the ring! macro.
extern crate ring_queue;
use Ring;
// `new` for an empty ring.
let r: = new;
// `with_capacity` for allocating the internal vector with the given
// capacity.
let r2: = with_capacity;
// `ring!` macro for easy initializing the ring.
let r3: = ring!;
// `from_iter` to construct the ring from an iterator.
use FromIterator;
let r4: = from_iter;
Instead of front and back as a nomenclature, this library uses left
to refer to the front an nothing to refer to the back, as the Python
collections.deque library does.
Items can be pushed to the left and right as well as popped.
extern crate ring_queue;
use Ring;
let mut r = ring!;
r.push;
r.push_left;
assert_eq!;
assert_eq!;
The ring can be rotated either to the left or to the right. Any positive
number will rotate n steps to the right and any negative number will
rotate n steps to the left.
extern crate ring_queue;
use Ring;
let mut r = ring!;
r.rotate;
assert_eq!;
r.rotate;
assert_eq!;
Ring implements collect to collect the elements in the ring as a vector
if the type of the elements implements the Copy trait.
It also implements into_iter to generate an iterator. However,
into_iter empties the ring.
extern crate ring_queue;
use Ring;
let mut r = ring!;
assert_eq!;
assert_eq!;
for item in r.into_iter
assert_eq!;
LICENSE
MIT License, see LICENSE