Struct id_vec::id::Id [−][src]
pub struct Id<T> { /* fields omitted */ }Used as a key to access an instance inside a IdVec
Methods
impl<T> Id<T>[src]
impl<T> Id<T>pub fn from_index(index: Index) -> Self[src]
pub fn from_index(index: Index) -> Selfpub fn of<'s>(self, vec: &'s IdVec<T>) -> &'s T[src]
pub fn of<'s>(self, vec: &'s IdVec<T>) -> &'s TConvenience function which allows writing the index first, and the IdVec afterwards.
Example: the_selected_entity.of(entities)
Panics when calling on an invalid id
pub fn of_mut<'s>(self, vec: &'s mut IdVec<T>) -> &'s mut T[src]
pub fn of_mut<'s>(self, vec: &'s mut IdVec<T>) -> &'s mut TConvenience function which allows writing the index first, and the IdVec afterwards.
Example: the_selected_entity.of_mut(entities)
Panics when calling on an invalid id
pub fn try_of<'s>(self, vec: &'s IdVec<T>) -> Option<&'s T>[src]
pub fn try_of<'s>(self, vec: &'s IdVec<T>) -> Option<&'s T>Convenience function which allows writing the index first, and the IdVec afterwards.
Example: the_selected_entity.try_of(entities)
pub fn try_of_mut<'s>(self, vec: &'s mut IdVec<T>) -> Option<&'s mut T>[src]
pub fn try_of_mut<'s>(self, vec: &'s mut IdVec<T>) -> Option<&'s mut T>Convenience function which allows writing the index first, and the IdVec afterwards.
Example: the_selected_entity.try_of_mut(entities)
pub fn index_value(self) -> Index[src]
pub fn index_value(self) -> IndexThe actual integer value for this Id.
Trait Implementations
impl<T> Index<Id<T>> for IdVec<T>[src]
impl<T> Index<Id<T>> for IdVec<T>type Output = T
The returned type after indexing.
fn index(&self, element: Id<T>) -> &T[src]
fn index(&self, element: Id<T>) -> &TPerforms the indexing (container[index]) operation.
impl<T> IndexMut<Id<T>> for IdVec<T>[src]
impl<T> IndexMut<Id<T>> for IdVec<T>fn index_mut(&mut self, element: Id<T>) -> &mut T[src]
fn index_mut(&mut self, element: Id<T>) -> &mut TPerforms the mutable indexing (container[index]) operation.
impl<T> Eq for Id<T>[src]
impl<T> Eq for Id<T>impl<T> PartialEq for Id<T>[src]
impl<T> PartialEq for Id<T>fn eq(&self, other: &Id<T>) -> bool[src]
fn eq(&self, other: &Id<T>) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<T> Copy for Id<T>[src]
impl<T> Copy for Id<T>impl<T> Clone for Id<T>[src]
impl<T> Clone for Id<T>fn clone(&self) -> Self[src]
fn clone(&self) -> SelfReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<T> Hash for Id<T>[src]
impl<T> Hash for Id<T>fn hash<H: Hasher>(&self, state: &mut H)[src]
fn hash<H: Hasher>(&self, state: &mut H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl<T> Debug for Id<T>[src]
impl<T> Debug for Id<T>