doc.rust-lang.org
pub fn into_vec(self) -> Vec<T, A>
Consumes the BinaryHeap and returns the underlying vector in arbitrary order.
method
alloc
Stable since 1.5.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_sorted_vec(self) -> Vec<T, A>
Consumes the BinaryHeap and returns a vector in sorted (ascending) order.
method
alloc
Stable since 1.5.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn drain(&mut self) -> Drain<'_, T, A>
Clears the binary heap, returning an iterator over the removed elements in arbitrary order. If the iterator is dropped before being fully consumed, it drops the remaining elements in arbitrary order.
method
alloc
Stable since 1.6.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn clear(&mut self)
Drops all items from the binary heap.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn capacity(&self) -> usize
Returns the number of elements the binary heap can hold without reallocating.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_slice(&self) -> &[T]
Returns a slice of all values in the underlying vector, in arbitrary order.
method
alloc
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn append(&mut self, other: &mut Self)
Moves all the elements of other into self, leaving other empty.
method
alloc
Stable since 1.11.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct BinaryHeap<T, A>
A priority queue implemented with a binary heap.
struct
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod binary_heap
A priority queue implemented with a binary heap.
module
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct TryReserveError
The error type for try_reserve methods.
struct
alloc
Stable since 1.57.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod collections
Collection types.
module
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_slice(&self) -> &[T]
Returns an immutable slice of all elements that have not been yielded yet.
method
alloc
Stable since 1.100.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice of all elements that have not been yielded yet.
method
alloc
Stable since 1.100.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct BoxedArrayIntoIter<T, const N: usize, A>
A by-value Box<[T; N]> iterator.
struct
alloc
Stable since 1.100.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn write(boxed: Self, value: T) -> Box<T, A>
Writes the value and converts to Box<T, A>.
associated_function
alloc
Stable since 1.87.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn pin(x: T) -> Pin<Box<T>>
Constructs a new Pin<Box<T>>. If T does not implement Unpin, then x will be pinned in memory and unable to be moved.
associated_function
alloc
Stable since 1.33.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new_zeroed_slice(len: usize) -> Box<[mem::MaybeUninit<T>]>
Constructs a new boxed slice with uninitialized contents, with the memory being filled with 0 bytes.
associated_function
alloc
Stable since 1.92.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new_zeroed() -> Box<mem::MaybeUninit<T>>
Constructs a new Box with uninitialized contents, with the memory being filled with 0 bytes.
associated_function
alloc
Stable since 1.92.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new_uninit_slice(len: usize) -> Box<[mem::MaybeUninit<T>]>
Constructs a new boxed slice with uninitialized contents.
associated_function
alloc
Stable since 1.82.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new_uninit() -> Box<mem::MaybeUninit<T>>
Constructs a new box with uninitialized contents.
associated_function
alloc
Stable since 1.82.0
Version 1.100.0-nightly