Struct id_map::IdMap [] [src]

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

A container that gives each item a unique id. Internally all elements are stored contiguously.

Methods

impl<T> IdMap<T>
[src]

[src]

Creates an empty IdMap<T>.

[src]

Creates an IdMap<T> with the specified capacity.

[src]

Removes all values from the map.

[src]

Returns the id that a subsequent call to insert() will produce.

[src]

Returns the number of id-value pairs in the map.

[src]

Returns the number of id-value pairs the map can hold before reallocating.

[src]

Resizes the map such that that capacity() >= cap.

[src]

Resizes the map to minimize allocated memory.

[src]

Returns a reference to the set of valid ids.

[src]

Inserts a value into an empty slot in the map and returns its id.

[src]

Inserts a value at a specific id, returning the old value if it existed.

[src]

Removes an id from the map, returning its value if it was previously in the map.

[src]

If the id has a value, returns it, otherwise inserts a new value.

[src]

If the id has a value, returns it, otherwise inserts a new value with the provided closure.

[src]

Removes all ids in the set from the map.

[src]

Remove all values not satisfying the predicate.

[src]

Returns true if the map contains a value for the specified id.

[src]

Returns a reference to the value at the specified id if it is in the map.

[src]

Returns a mutable reference to the value at the specified id if it is in the map.

[src]

An iterator over ids, in increasing order.

[src]

An iterator over values, in order of increasing id.

[src]

A mutable iterator over values, in order of increasing id.

[src]

An iterator over id-value pairs, in order of increasing id.

[src]

A mutable iterator over id-value pairs, in order of increasing id.

[src]

A consuming iterator over id-value pairs, in order of increasing id.

Trait Implementations

impl<T> Drop for IdMap<T>
[src]

[src]

Executes the destructor for this type. Read more

impl<T: Clone> Clone for IdMap<T>
[src]

[src]

Returns a copy of the value. Read more

[src]

Performs copy-assignment from source. Read more

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

[src]

Formats the value using the given formatter.

impl<T> Default for IdMap<T>
[src]

[src]

Returns the "default value" for a type. Read more

impl<T: Eq> Eq for IdMap<T>
[src]

impl<T: PartialEq> PartialEq for IdMap<T>
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl<T> Extend<T> for IdMap<T>
[src]

[src]

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

impl<T> FromIterator<T> for IdMap<T>
[src]

[src]

Creates a value from an iterator. Read more

impl<T> FromIterator<(Id, T)> for IdMap<T>
[src]

[src]

Creates a value from an iterator. Read more

impl<'a, T> IntoIterator for &'a IdMap<T>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

impl<'a, T> IntoIterator for &'a mut IdMap<T>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

impl<T> IntoIterator for IdMap<T>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

impl<T> Index<Id> for IdMap<T>
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl<T> IndexMut<Id> for IdMap<T>
[src]

[src]

Performs the mutable indexing (container[index]) operation.