pub struct PtrID<E, P>(/* private fields */);Implementations§
Source§impl<E, P: IAllocPolicy> PtrID<E, P>
impl<E, P: IAllocPolicy> PtrID<E, P>
pub unsafe fn from_nonnull(ptr: NonNull<Unit<E>>) -> Self
pub unsafe fn into_nonnull(self) -> NonNull<Unit<E>>
pub unsafe fn from_raw_ptr(ptr: *mut Unit<E>) -> Self
pub unsafe fn into_raw_ptr(self) -> *mut Unit<E>
pub fn from_ref(unit: &Unit<E>) -> Self
pub fn get_index(self, alloc: &EntityAlloc<E, P>) -> Option<usize>
pub unsafe fn direct_get_indexed(self) -> usize
pub unsafe fn direct_deref<'a>(self) -> &'a E
pub unsafe fn direct_deref_mut<'a>(self) -> &'a mut E
pub fn validate( &self, alloc: &EntityAlloc<E, P>, ) -> Result<usize, SlicePtrError>
pub fn validate_mut( &self, alloc: &mut EntityAlloc<E, P>, ) -> Result<usize, SlicePtrError>
Trait Implementations§
Source§impl<E, P: IAllocPolicy> IEntityAllocID<E, P> for PtrID<E, P>
impl<E, P: IAllocPolicy> IEntityAllocID<E, P> for PtrID<E, P>
fn from_ptr(_: &EntityAlloc<E, P>, ptr: PtrID<E, P>) -> Option<Self>
fn from_index(alloc: &EntityAlloc<E, P>, indexed: usize) -> Option<Self>
fn try_deref(self, alloc: &EntityAlloc<E, P>) -> Option<&E>
fn try_deref_mut(self, alloc: &mut EntityAlloc<E, P>) -> Option<&mut E>
fn free(self, alloc: &mut EntityAlloc<E, P>) -> Option<E>
fn deref(self, alloc: &EntityAlloc<E, P>) -> &E
fn deref_mut(self, alloc: &mut EntityAlloc<E, P>) -> &mut E
Source§impl<T, P: IAllocPolicy> IPolicyPtrID for PtrID<T, P>
impl<T, P: IAllocPolicy> IPolicyPtrID for PtrID<T, P>
type ObjectT = T
type PolicyT = P
fn from_raw_ptrid(ptr: PtrID<Self::ObjectT, Self::PolicyT>) -> Self
fn into_raw_ptrid(self) -> PtrID<Self::ObjectT, Self::PolicyT>
fn deref_alloc( self, alloc: &EntityAlloc<Self::ObjectT, Self::PolicyT>, ) -> &Self::ObjectT
fn deref_from_alloc_mut( self, alloc: &mut EntityAlloc<Self::ObjectT, Self::PolicyT>, ) -> &mut Self::ObjectT
Source§impl<E, P> Ord for PtrID<E, P>
impl<E, P> Ord for PtrID<E, P>
Source§impl<E, P> PartialOrd for PtrID<E, P>
impl<E, P> PartialOrd for PtrID<E, P>
impl<E, P> Copy for PtrID<E, P>
impl<E, P> Eq for PtrID<E, P>
impl<E: Send, P> Send for PtrID<E, P>
impl<E: Sync, P> Sync for PtrID<E, P>
Auto Trait Implementations§
impl<E, P> Freeze for PtrID<E, P>
impl<E, P> RefUnwindSafe for PtrID<E, P>where
P: RefUnwindSafe,
E: RefUnwindSafe,
impl<E, P> Unpin for PtrID<E, P>where
P: Unpin,
impl<E, P> UnwindSafe for PtrID<E, P>where
P: UnwindSafe,
E: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more