doc.rust-lang.org
pub fn as_mut_slices(&mut self) -> (&mut [T], &mut [T])
Returns a pair of slices which contain, in order, the contents of the deque.
method
alloc
Stable since 1.5.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_slices(&self) -> (&[T], &[T])
Returns a pair of slices which contain, in order, the contents of the deque.
method
alloc
Stable since 1.5.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn back(&self) -> Option<&T>
Provides a reference to the back element, or None if the deque is empty.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn back_mut(&mut self) -> Option<&mut T>
Provides a mutable reference to the back element, or None if the deque is empty.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn binary_search(&self, x: &T) -> Result<usize, usize>
Binary searches this VecDeque for a given element. If the VecDeque is not sorted, the returned result is unspecified and meaningless.
method
alloc
Stable since 1.54.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
Binary searches this VecDeque with a comparator function.
method
alloc
Stable since 1.54.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn binary_search_by_key<'a, B, F>(&'a self, b: &B, f: F) -> Result<usize, usize>
Binary searches this VecDeque with a key extraction function.
method
alloc
Stable since 1.54.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn capacity(&self) -> usize
Returns the number of elements the deque can hold without reallocating.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn clear(&mut self)
Clears the deque, removing all values.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn contains(&self, x: &T) -> bool
Returns true if the deque contains an element equal to the given value.
method
alloc
Stable since 1.12.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A>
Removes the specified range from the deque in bulk, returning all removed elements as an iterator. If the iterator is dropped before being fully consumed, it drops the remaining removed elements.
method
alloc
Stable since 1.6.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn front(&self) -> Option<&T>
Provides a reference to the front element, or None if the deque is empty.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn front_mut(&mut self) -> Option<&mut T>
Provides a mutable reference to the front element, or None if the deque is empty.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn get(&self, index: usize) -> Option<&T>
Provides a reference to the element at the given index.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn get_mut(&mut self, index: usize) -> Option<&mut T>
Provides a mutable reference to the element at the given index.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn insert(&mut self, index: usize, value: T)
Inserts an element at index within the deque, shifting all elements with indices greater than or equal to index towards the back.
method
alloc
Stable since 1.5.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn insert_mut(&mut self, index: usize, value: T) -> &mut T
Inserts an element at index within the deque, shifting all elements with indices greater than or equal to index towards the back, and returning a reference to it.
method
alloc
Stable since 1.95.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_empty(&self) -> bool
Returns true if the deque is empty.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn iter(&self) -> Iter<'_, T>
Returns a front-to-back iterator.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn iter_mut(&mut self) -> IterMut<'_, T>
Returns a front-to-back iterator that returns mutable references.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly