Struct radix_heap::RadixHeapMap[][src]

pub struct RadixHeapMap<K, V> { /* fields omitted */ }
Expand description

A montone priority queue implemented using a radix heap.

This will be a max-heap.

See the module documentation for more information.

It is a logic error for a key to be modified in such a way that the item’s ordering relative to any other item, as determined by the Ord trait, changes while it is in the heap. This is normally only possible through Cell, RefCell, global state, I/O, or unsafe code.

Implementations

Create an empty RadixHeapMap

Create an empty RadixHeapMap with the top key set to a specific value.

This can be more efficient if you have a known minimum bound of the items being pushed to the heap.

Drops all items form the RadixHeapMap and sets the top key to None.

Drop all items from the RadixHeapMap and sets the top key to a specific value.

This can be more efficient if you have a known maximum bound of the items being pushed to the heap.

Sets the top value to the current maximum key value in the heap

Pushes a new key value pair onto the heap.

Panics

Panics if the key is larger than the current top key.

Remove the greatest element from the heap and returns it, or None if empty.

If there is a tie between multiple elements, the last inserted element will be popped first.

This will set the top key to the extracted key.

Returns the number of elements in the heap

Returns true if there is no elements in the heap

The current top value. All keys pushed onto the heap must be smaller than this value.

Discards as much additional capacity as possible.

Returns an iterator of all key-value pairs in the RadixHeapMap in arbitrary order

Returns an iterator of all keys in the RadixHeapMap in arbitrary order

Returns an iterator of all values in the RadixHeapMap in arbitrary order

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

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

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

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

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Creates a value from an iterator. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.