pub struct TreeMap<K, V> { /* private fields */ }
Expand description

TreeMap based on AVL-tree

Runtime complexity (worst case):

  • get/contains_key: O(1) - UnorderedMap lookup
  • insert/remove: O(log(N))
  • min/max: O(log(N))
  • above/below: O(log(N))
  • range of K elements: O(Klog(N))

Implementations

Returns the smallest stored key from the tree

Returns the largest stored key from the tree

Returns the smallest key that is strictly greater than key given as the parameter

Returns the largest key that is strictly less than key given as the parameter

Returns the smallest key that is greater or equal to key given as the parameter

Returns the largest key that is less or equal to key given as the parameter

Iterate all entries in ascending order: min to max, both inclusive

Iterate entries in ascending order: given key (exclusive) to max (inclusive)

Iterate all entries in descending order: max to min, both inclusive

Iterate entries in descending order: given key (exclusive) to min (inclusive)

Iterate entries in ascending order according to specified bounds.

Panics

Panics if range start > end. Panics if range start == end and both bounds are Excluded.

Helper function which creates a [Vec<(K, V)>] of all items in the TreeMap. This function collects elements from TreeMap::iter.

Trait Implementations

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes. Read more

Deserialize this instance from a slice of bytes.

Serialize this instance into a vector of bytes.

Formats the value using the given formatter. 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.

Should always be Self

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.