Struct sid_vec::IdFreeList [] [src]

pub struct IdFreeList<ID: Identifier, Data, C: NullId<ID>> { /* fields omitted */ }

A linked list stored in contiguous memory allowing random access through ids.

Methods

impl<ID: Identifier, Data, C: NullId<ID>> IdFreeList<ID, Data, C>
[src]

Create an empty list.

Create an empty list with a preallocated buffer.

Add an element to the list and return the id pointing to it

Add an element to the list at the end of the vector storage (without attempting to occupy a slot from the free-list). This means that repeated calls to push without calls to add or remove will produce contiguous indices.

Remove a given element from the list and place the slot in the free-list. Note that this does not attempt to drop the element.

Count the elements in O(N).

Return true if the id is found in the list in O(N).

Return true if there is no element in the list.

Remove all elements from the list and clears the storage. Note that this will Drop the elements if Data implements Drop.

Return the next id in the list.

Return the previous id in the list.

Return the first id in the list.

Trait Implementations

impl<ID: Identifier, Data, C: NullId<ID>> Index<ID> for IdFreeList<ID, Data, C>
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<ID: Identifier, Data, C: NullId<ID>> IndexMut<ID> for IdFreeList<ID, Data, C>
[src]

The method for the mutable indexing (container[index]) operation