Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
doc.rust-lang.org
pub struct PeekMut<'a, T, A>
Structure wrapping a mutable reference to the greatest item on a BinaryHeap.
struct alloc Stable since 1.12.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct Iter<'a, T>
An iterator over the elements of a BinaryHeap.
struct alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct IntoIter<T, A>
An owning iterator over the elements of a BinaryHeap.
struct alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub struct Drain<'a, T, A>
A draining iterator over the elements of a BinaryHeap.
struct alloc Stable since 1.6.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn with_capacity(capacity: usize) -> BinaryHeap<T>
Creates an empty BinaryHeap with at least the specified capacity.
associated_function alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError>
Tries to reserve the minimum capacity for at least additional elements more than the current length. Unlike try_reserve, this will not deliberately over-allocate to speculatively avoid frequent allocations. After calling try_reserve_exact, capacity will be greater than or equal to self.len() + additional if it returns Ok(()). Does nothing if the capacity is already sufficient.
method alloc Stable since 1.63.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
Tries to reserve capacity for at least additional elements more than the current length. The allocator may reserve more space to speculatively avoid frequent allocations. After calling try_reserve, capacity will be greater than or equal to self.len() + additional if it returns Ok(()). Does nothing if capacity is already sufficient. This method preserves the contents even if an error occurs.
method alloc Stable since 1.63.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn shrink_to_fit(&mut self)
Discards as much additional capacity as possible.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn shrink_to(&mut self, min_capacity: usize)
Discards capacity with a lower bound.
method alloc Stable since 1.56.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.70.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 elements more than the current length. Unlike reserve, this will not deliberately over-allocate to speculatively avoid frequent allocations. After calling reserve_exact, capacity will be greater than or equal to self.len() + additional. 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 elements more than the current length. The allocator may reserve more space to speculatively avoid frequent allocations. After calling reserve, capacity will be greater than or equal to self.len() + additional. Does nothing if capacity is already sufficient.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn push(&mut self, item: T)
Pushes an item onto the binary heap.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn pop(&mut self) -> Option<T>
Removes the greatest item from the binary heap 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 peek_mut(&mut self) -> Option<PeekMut<'_, T, A>>
Returns a mutable reference to the greatest item in the binary heap, or None if it is empty.
method alloc Stable since 1.12.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn peek(&self) -> Option<&T>
Returns the greatest item in the binary heap, or None if it is empty.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new() -> BinaryHeap<T>
Creates an empty BinaryHeap as a max-heap.
associated_function alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn len(&self) -> usize
Returns the length of the binary heap.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn iter(&self) -> Iter<'_, T>
Returns an iterator visiting all values in the underlying vector, in arbitrary order.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
doc.rust-lang.org
pub fn is_empty(&self) -> bool
Checks if the binary heap is empty.
method alloc Stable since 1.0.0 Version 1.100.0-nightly
"In addition to rewriting the tools in Rust, a safer language, some little-used features of sudo were not implemented in order to reduce vulnerability ..."

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.