Struct obj_pool::ObjId [−][src]
pub struct ObjId(_);
An id of the object in an ObjPool.
In release it is basically just an index in the underlying vector, but in debug it's an index +
ObjPool-specific offset. This is made to be able to check ObjId if it's from the same
ObjPool we are trying to get an object from.
Methods
impl ObjId[src]
impl ObjIdpub fn into_index(self, offset: u32) -> u32[src]
pub fn into_index(self, offset: u32) -> u32pub fn from_index(index: u32, offset: u32) -> ObjId[src]
pub fn from_index(index: u32, offset: u32) -> ObjIdMethods from Deref<Target = u32>
Trait Implementations
impl Copy for ObjId[src]
impl Copy for ObjIdimpl Clone for ObjId[src]
impl Clone for ObjIdfn clone(&self) -> ObjId[src]
fn clone(&self) -> ObjIdReturns 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 PartialEq for ObjId[src]
impl PartialEq for ObjIdfn eq(&self, other: &ObjId) -> bool[src]
fn eq(&self, other: &ObjId) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &ObjId) -> bool[src]
fn ne(&self, other: &ObjId) -> boolThis method tests for !=.
impl Eq for ObjId[src]
impl Eq for ObjIdimpl Hash for ObjId[src]
impl Hash for ObjIdfn 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 Debug for ObjId[src]
impl Debug for ObjIdfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Display for ObjId[src]
impl Display for ObjIdfn fmt(&self, f: &mut Formatter) -> Result<(), Error>[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>Formats the value using the given formatter. Read more
impl FromStr for ObjId[src]
impl FromStr for ObjIdtype Err = ParseIntError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>[src]
fn from_str(s: &str) -> Result<Self, Self::Err>Parses a string s to return a value of this type. Read more
impl Deref for ObjId[src]
impl Deref for ObjIdtype Target = u32
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target[src]
fn deref(&self) -> &Self::TargetDereferences the value.
impl From<u32> for ObjId[src]
impl From<u32> for ObjIdimpl InvalidValue<ObjId> for ObjId[src]
impl InvalidValue<ObjId> for ObjIdfn invalid_value() -> ObjId[src]
fn invalid_value() -> ObjIdimpl<T> Index<ObjId> for ObjPool<T>[src]
impl<T> Index<ObjId> for ObjPool<T>type Output = T
The returned type after indexing.
fn index(&self, obj_id: ObjId) -> &T[src]
fn index(&self, obj_id: ObjId) -> &TPerforms the indexing (container[index]) operation.
impl<T> IndexMut<ObjId> for ObjPool<T>[src]
impl<T> IndexMut<ObjId> for ObjPool<T>