Struct leonardo_heap::LeonardoHeap [] [src]

pub struct LeonardoHeap<T> { /* fields omitted */ }

Methods

impl<T: Ord + Debug> LeonardoHeap<T>
[src]

Creates a new, empty LeonardoHeap<T>

Creates a new LeonardoHeap<T> with space allocated for at least capacity elements.

Returns the number of elements for which space has been allocated.

Reserve at least enough space for additional elements to be pushed on to the heap.

Reserves the minimum capacity for exactly additional elements to be pushed onto the heap.

Shrinks the capacity of the underlying storage to free up as much space as possible.

Removes all elements from the heap that do not match a predicate.

Removes all elements from the heap.

Returns the number of elements in the heap.

Returns true if the heap contains no elements, false otherwise.

Removes duplicate elements from the heap, preserving heap order.

Forces sorting of the entire underlying array. The sorted array is still a valid leonardo heap.

Adds a new element to the heap. The heap will be rebalanced to maintain the string and heap properties.

Elements pushed more than once will not be deduplicated.

Returns a reference to the largest element in the heap without removing it.

Removes and returns the largest element in the heap. If the heap is empty, returns None.

Returns a sorted iterator over the elements in the heap.

Will lazily sort the top elements of the heap in-place as it is consumed.

Returns an iterator that removes and returns elements from the top of the heap.

Trait Implementations

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

Formats the value using the given formatter.