pub struct ObjId(pub NonZeroU32);Expand description
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.
Tuple Fields
0: NonZeroU32Implementations
sourceimpl ObjId
impl ObjId
pub fn from_index(index: u32) -> Self
pub const fn into_index(self) -> u32
Methods from Deref<Target = NonZeroU32>
pub const MIN: NonZeroU32 = Self::new(1).unwrap()
pub const MAX: NonZeroU32 = Self::new(u32::MAX).unwrap()
Trait Implementations
sourceimpl Deref for ObjId
impl Deref for ObjId
type Target = NonZeroU32
type Target = NonZeroU32
The resulting type after dereferencing.
sourceimpl From<NonZeroU32> for ObjId
impl From<NonZeroU32> for ObjId
sourcefn from(v: NonZeroU32) -> ObjId
fn from(v: NonZeroU32) -> ObjId
Converts to this type from the input type.
impl Copy for ObjId
impl Eq for ObjId
impl StructuralEq for ObjId
impl StructuralPartialEq for ObjId
Auto Trait Implementations
impl RefUnwindSafe for ObjId
impl Send for ObjId
impl Sync for ObjId
impl Unpin for ObjId
impl UnwindSafe for ObjId
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more