logo
pub struct OrderedMap<V, S = RandomState> { /* private fields */ }
Expand description

A newtype wrapping indexmap::IndexMap

Implementations

Return the number of key-value pairs in the map, including empty values.

Computes in O(1) time.

Gets the number of key-value pairs in the map, not including empty values.

Computes in O(1) time.

Returns true if the map contains no elements.

Computes in O(1) time.

Insert a key-value pair in the map.

If an equivalent key already exists in the map: the key remains and retains in its place in the order, its corresponding value is updated with value and the older value is returned inside Some(_).

If no equivalent key existed in the map: the new key-value pair is inserted, last in order, and None is returned.

Computes in O(1) time (amortized average).

Remove the key-value pair equivalent to key and return its value.

Like Vec::remove, the pair is removed by shifting all of the elements that follow it, preserving their relative order. This perturbs the index of all of those elements!

Return None if key is not in map.

Computes in O(n) time (average).

Removes all elements from the map and resets the counter of empty entries.

Return a reference to the value stored for key, if it is present, else None.

Computes in O(1) time (average).

Get a key-value pair by index.

Valid indices are 0 <= index < self.full_len().

Computes in O(1) time.

Return an iterator over the key-value pairs of the map, in their order

Return true if an equivalent to key exists in the map.

Computes in O(1) time (average).

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
Marks all contained Gcs.
Increments the root-count of all contained Gcs.
Decrements the root-count of all contained Gcs.
Runs Finalize::finalize() on this object and all contained subobjects 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert the Rust type which implements NativeObject to a &dyn Any.
Convert the Rust type which implements NativeObject to a &mut dyn Any.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.