Struct contiguous_map::ContiguousMap[][src]

pub struct ContiguousMap<K: Key, V> { /* fields omitted */ }
Expand description

An ordered, associative container like std::collections::BTreeMap. Additionally stores values with adjacent keys contiguously so they may be accessed as a slice.

Implementations

Makes a new, empty ContiguousMap.

Gets the number of entries in this map.

This is the total number of values in the map, not the number of contiguous regions. For the number of contiguous regions use ContiguousMap::num_contiguous_regions()

Gets if this map is empty.

Gets the number of contiguous regions in this map.

This is the number of (key, slice) tuples that will be iterated over by iterators returned by ContiguousMap::iter_slice() and ContiguousMap::iter_slice_mut().

This is also th number of (key, vector) tuples that will be iterated over by iterators returned by ContiguousMap::iter_vec().

Inserts a value into a map with a given key. Returns the old value for this key if one existed.

Inserts values into the map from a slice starting at a given key.

Removes a key’s value in this map, returning it if it existed.

Removes all entries from this map.

Removes all entries within a range of keys.

Removes all entries starting at the provided key for the next len adjacent keys.

Returns a reference to a key’s value, if it exists.

Returns a mutable reference to a key’s value, if it exists.

Gets a slice from this map using a range of keys.

Gets a slice from this map using a key and a length.

Gets a mutable slice from this map using a range of keys.

Gets a mutable slice from this map using a key and a length.

Iteration over all keys and values in this map in ascending key order.

Unlike std::collections::BTreeMap the tuples yielded by the iterator contains a key directly instead of a reference to a key. This is due to how contiguous regions are stored internally.

Mutable iteration over all keys and values in this map in ascending key order.

Unlike std::collections::BTreeMap the tuples yielded by the iterator contains a key directly instead of a reference to a key. This is due to how contiguous regions are stored internally.

Iteration over a range of keys and values in this map in ascending key order.

Unlike std::collections::BTreeMap the tuples yielded by the iterator contains a key directly instead of a reference to a key. This is due to how contiguous regions are stored internally.

Mutable iteration over a range of keys and values in this map in ascending key order.

Unlike std::collections::BTreeMap the tuples yielded by the iterator contains a key directly instead of a reference to a key. This is due to how contiguous regions are stored internally.

Owning iteration over all keys and values in this map grouped up in contiguous regions in ascending key order.

The iterator yields tuples containing a key and vector of values. The key of each value is its index in the vector plus the key in the tuple.

The iterator will never yield a tuple with an empty vector.

Iteration over all keys and values in this map grouped up in contiguous regions in ascending key order.

The iterator yields tuples containing a key and slice of values. The key of each value is its index in the slice plus the key in the tuple.

The iterator will never yield a tuple with an empty slice.

Mutable iteration over all keys and values in this map grouped up in contiguous regions in ascending key order.

The iterator yields tuples containing a key and slice of values. The key of each value is its index in the slice plus the key in the tuple.

The iterator will never yield a tuple with an empty slice.

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

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

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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.