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]
impl<T: Hash> Hash for Id<T>
[src]
fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl<T: PartialOrd> PartialOrd for Id<T>
[src]
fn partial_cmp(&self, __arg_0: &Id<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Id<T>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Id<T>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Id<T>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Id<T>) -> bool
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]
fn cmp(&self, __arg_0: &Id<T>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl<T: PartialEq> PartialEq for Id<T>
[src]
fn eq(&self, __arg_0: &Id<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Id<T>) -> bool
This method tests for !=
.
impl<T: Eq> Eq for Id<T>
[src]
impl<T> Clone for Id<T>
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more