Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub fn len(&self) -> usize
Returns the number of elements in the deque.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn make_contiguous(&mut self) -> &mut [T]
Rearranges the internal storage of this deque so it is one contiguous slice, which is then returned.
method alloc Stable since 1.48.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new() -> VecDeque<T>
Creates an empty deque.
associated_function alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn partition_point<P>(&self, pred: P) -> usize
Returns the index of the partition point according to the given predicate (the index of the first element of the second partition).
method alloc Stable since 1.54.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn pop_back(&mut self) -> Option<T>
Removes the last element from the deque and returns it, or None if it is empty.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn pop_back_if(&mut self, predicate: impl FnOnce(&mut T) -> bool) -> Option<T>
Removes and returns the last element from the deque if the predicate returns true, or None if the predicate returns false or the deque is empty (the predicate will not be called in that case).
method alloc Stable since 1.93.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn pop_front(&mut self) -> Option<T>
Removes the first element and returns it, 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 pop_front_if(&mut self, predicate: impl FnOnce(&mut T) -> bool) -> Option<T>
Removes and returns the first element from the deque if the predicate returns true, or None if the predicate returns false or the deque is empty (the predicate will not be called in that case).
method alloc Stable since 1.93.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
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_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_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 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 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 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 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 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 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 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 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
"Learning Rust has taught me something - "There are really no problems, just adventure and opportunities""

Search tips

Type anything to search across articles, videos (including conference talks), podcasts, research, crates, and Rust API documentation. These operators give you finer control — click an example to try it.

Find pages containing all your words. Pages where the words appear together rank higher.
Quote part of your query to keep those words together as an exact phrase within a larger search.
Wrap the whole query in quotes for a verbatim search that matches text exactly, punctuation and all — perfect for Rust syntax. Needs at least 3 characters.
Put ! first to open the top result immediately. Quote the whole query for a literal leading bang, as in '!Send'. Bangs elsewhere, such as println!, stay literal. Browser and launcher shortcuts can invoke this directly. See search integrations.
Limit results to a single site. Works on its own () too. One site: per search.

Use the tabs and filters above the results to narrow by content type, publication year, and sort order.