Struct min_max_heap::MinMaxHeap [] [src]

pub struct MinMaxHeap<T>(_);

A double-ended priority queue.

Methods

impl<T> MinMaxHeap<T>
[src]

[src]

Creates a new, empty MinMaxHeap.

[src]

Creates a new, empty MinMaxHeap with space allocated to hold len elements.

[src]

The number of elements in the heap.

[src]

Is the heap empty?

impl<T: Ord> MinMaxHeap<T>
[src]

[src]

Adds an element to the heap.

[src]

Gets a reference to the minimum element, if any.

[src]

Gets a reference to the maximum element, if any.

[src]

Removes the minimum element, if any.

[src]

Removes the maximum element, if any.

[src]

Pushes an element, then pops the minimum element.

Unlike a push followed by a pop, this combined operation will not allocate.

[src]

Pushes an element, then pops the maximum element in an optimized fashion.

Unlike a push followed by a pop, this combined operation will not allocate.

[src]

Pops the minimum, then pushes an element in an optimized fashion.

[src]

Pops the maximum, then pushes an element in an optimized fashion.

[src]

Returns an ascending (sorted) vector, reusing the heap’s storage.

[src]

Returns an descending (sorted) vector, reusing the heap’s storage.

impl<T> MinMaxHeap<T>
[src]

[src]

Drops all items from the heap.

[src]

The number of elements the heap can hold without reallocating.

[src]

Reserves the minimum capacity for exactly additional more elements to be inserted in the given MinMaxHeap.

Panics

Panics if the new capacity overflows usize.

[src]

Reserves the minimum capacity for at least additional more elements to be inserted in the given MinMaxHeap.

Panics

Panics if the new capacity overflows usize.

[src]

Discards extra capacity.

[src]

Consumes the MinMaxHeap and returns its elements in a vector in arbitrary order.

Important traits for Iter<'a, T>
[src]

Returns a borrowing iterator over the min-max-heap’s elements in arbitrary order.

Important traits for Drain<'a, T>
[src]

Returns a draining iterator over the min-max-heap’s elements in arbitrary order.

Trait Implementations

impl<T: Clone> Clone for MinMaxHeap<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for MinMaxHeap<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T> Default for MinMaxHeap<T>
[src]

[src]

Returns the "default value" for a type. Read more

impl<'a, T> IntoIterator for &'a MinMaxHeap<T>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

impl<'a, T> IntoIterator for MinMaxHeap<T>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

impl<T: Ord> FromIterator<T> for MinMaxHeap<T>
[src]

[src]

Creates a value from an iterator. Read more

impl<T: Ord> From<Vec<T>> for MinMaxHeap<T>
[src]

[src]

Performs the conversion.

impl<T: Ord> Extend<T> for MinMaxHeap<T>
[src]

[src]

Extends a collection with the contents of an iterator. Read more

impl<'a, T: Ord + Clone + 'a> Extend<&'a T> for MinMaxHeap<T>
[src]

[src]

Extends a collection with the contents of an iterator. Read more

Auto Trait Implementations

impl<T> Send for MinMaxHeap<T> where
    T: Send

impl<T> Sync for MinMaxHeap<T> where
    T: Sync