pub struct VecDeque<'a, T> { /* private fields */ }
Expand description

A deque stores multiple items at the given key. It provides efficient FIFO and LIFO access, as well as direct index access.

It has a maximum capacity of u32::MAX - 1. Make sure to never exceed that number when using this type. If you do, the methods won’t work as intended anymore.

Implementations

Adds the given value to the end of the deque

Adds the given value to the front of the deque

Removes the last element of the deque and returns it

Removes the first element of the deque and returns it

Returns the first element of the deque without removing it

Returns the first element of the deque without removing it

Gets the length of the deque.

Returns true if the deque contains no elements.

Returns the value at the given position in the queue or None if the index is out of bounds

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.