Struct idcontain::Id [] [src]

pub struct Id<T> {
    // some fields omitted
}

The Id of an element of type T as returned by IdVec insertions.

Id-s are opaque, but Copy, comparable and hashable. Think of an Id as a safe *const T which you can dereference if you have a reference to the originating IdVec.

Implementation

Internally an Id is implemented as an (index, tag) pair. The index points to a slot in the IdVec, while the tag allows disambiguating between values when a slot gets reused (a matching tag is stored in the slot and is incremented every time a value is removed from that slot).

Trait Implementations

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

Formats the value using the given formatter.

impl<T: Hash> Hash for Id<T>
[src]

Feeds this value into the state given, updating the hasher as necessary.

Feeds a slice of this type into the state provided.

impl<T: PartialOrd> PartialOrd for Id<T>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: Ord> Ord for Id<T>
[src]

This method returns an Ordering between self and other. Read more

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

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

This method tests for !=.

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

impl<T> Clone for Id<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T> Copy for Id<T>
[src]