doc.rust-lang.org
pub fn swap(&mut self, i: usize, j: usize)
Swaps elements at indices i and j.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn split_off(&mut self, at: usize) -> Self
Splits the deque into two at the given index.
method
alloc
Stable since 1.4.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the deque as much as possible.
method
alloc
Stable since 1.5.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn shrink_to(&mut self, min_capacity: usize)
Shrinks the capacity of the deque with a lower bound.
method
alloc
Stable since 1.56.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn rotate_right(&mut self, n: usize)
Rotates the double-ended queue n places to the right.
method
alloc
Stable since 1.36.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn rotate_left(&mut self, n: usize)
Rotates the double-ended queue n places to the left.
method
alloc
Stable since 1.36.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn retain_mut<F>(&mut self, f: F)
Retains only the elements specified by the predicate.
method
alloc
Stable since 1.61.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn retain_back(&mut self, len: usize)
Shortens the deque, keeping the last len elements and dropping the rest.
method
alloc
Stable since 1.100.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn retain<F>(&mut self, f: F)
Retains only the elements specified by the predicate.
method
alloc
Stable since 1.4.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn resize_with(&mut self, new_len: usize, generator: impl FnMut() -> T)
Modifies the deque in-place so that len() is equal to new_len, either by removing excess elements from the back or by appending elements generated by calling generator to the back.
method
alloc
Stable since 1.33.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn resize(&mut self, new_len: usize, value: T)
Modifies the deque in-place so that len() is equal to new_len, either by removing excess elements from the back or by appending clones of value to the back.
method
alloc
Stable since 1.16.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn reserve_exact(&mut self, additional: usize)
Reserves the minimum capacity for at least additional more elements to be inserted in the given deque. Does nothing if the capacity is already sufficient.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional more elements to be inserted in the given deque. The collection may reserve more space to speculatively avoid frequent reallocations.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn remove(&mut self, index: usize) -> Option<T>
Removes and returns the element at index from the deque. Whichever end is closer to the removal point will be moved to make room, and all the affected elements will be moved to new positions. Returns None if index is out of bounds.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn range_mut<R>(&mut self, range: R) -> IterMut<'_, T>
Creates an iterator that covers the specified mutable range in the deque.
method
alloc
Stable since 1.51.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn range<R>(&self, range: R) -> Iter<'_, T>
Creates an iterator that covers the specified range in the deque.
method
alloc
Stable since 1.51.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn push_front_mut(&mut self, value: T) -> &mut T
Prepends an element to the deque, returning a reference to it.
method
alloc
Stable since 1.95.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn push_front(&mut self, value: T)
Prepends an element to the deque.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn push_back_mut(&mut self, value: T) -> &mut T
Appends an element to the back of the deque, returning a reference to it.
method
alloc
Stable since 1.95.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn push_back(&mut self, value: T)
Appends an element to the back of the deque.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly