VecDeque::with_capacity
pub static fn with_capacity(int cap) -> VecDeque<T> Import
Source: use collections::deque::{VecDeque}; src/collections/deque.hy Empty deque with ring capacity rounded up to the next power of two (min 8).
Parameters#
| Name | Type |
|---|---|
cap | int |
Returns#
VecDeque<T>
See also#
VecDeque: A double-ended queue: constant-time push and pop at both ends.VecDeque::new: Empty deque with default capacity 8.VecDeque::size: Returns the number of values.VecDeque::is_empty: Returnstruewhen the deque has no values.VecDeque::capacity: Returns how many values fit before the ring buffer grows.VecDeque::push_back: Addsvat the back.VecDeque::push_front: Addsvat the front.VecDeque::peek_front: Returns the front value without removing it, orNonewhen the deque is empty.