Struct specs::saveload::SimpleMarkerAllocator
source · pub struct SimpleMarkerAllocator<T: ?Sized> { /* private fields */ }
Expand description
Basic marker allocator, uses u64
as identifier
Implementations§
Trait Implementations§
source§impl<T: ?Sized> Clone for SimpleMarkerAllocator<T>
impl<T: ?Sized> Clone for SimpleMarkerAllocator<T>
source§impl<T: ?Sized> Debug for SimpleMarkerAllocator<T>
impl<T: ?Sized> Debug for SimpleMarkerAllocator<T>
source§impl<T: ?Sized> Default for SimpleMarkerAllocator<T>
impl<T: ?Sized> Default for SimpleMarkerAllocator<T>
source§impl<T> MarkerAllocator<SimpleMarker<T>> for SimpleMarkerAllocator<T>where
T: 'static + ?Sized + Send + Sync,
impl<T> MarkerAllocator<SimpleMarker<T>> for SimpleMarkerAllocator<T>where T: 'static + ?Sized + Send + Sync,
source§fn allocate(&mut self, entity: Entity, id: Option<u64>) -> SimpleMarker<T>
fn allocate(&mut self, entity: Entity, id: Option<u64>) -> SimpleMarker<T>
Allocates a new marker for a given entity.
If you don’t pass an id, a new unique id will be created.
source§fn retrieve_entity_internal(&self, id: u64) -> Option<Entity>
fn retrieve_entity_internal(&self, id: u64) -> Option<Entity>
Get an
Entity
by a marker identifier.
This function only accepts an id; it does not update the marker data. Read moresource§fn maintain(
&mut self,
entities: &EntitiesRes,
storage: &ReadStorage<'_, SimpleMarker<T>>
)
fn maintain( &mut self, entities: &EntitiesRes, storage: &ReadStorage<'_, SimpleMarker<T>> )
Maintain internal data. Cleanup if necessary.
source§fn retrieve_entity(
&mut self,
marker: M,
storage: &mut WriteStorage<'_, M>,
entities: &EntitiesRes
) -> Entity
fn retrieve_entity( &mut self, marker: M, storage: &mut WriteStorage<'_, M>, entities: &EntitiesRes ) -> Entity
Tries to retrieve an entity by the id of the marker;
if no entity has a marker with the same id, a new entity
will be created and
marker
will be inserted for it. Read moreAuto Trait Implementations§
impl<T: ?Sized> RefUnwindSafe for SimpleMarkerAllocator<T>where T: RefUnwindSafe,
impl<T: ?Sized> Send for SimpleMarkerAllocator<T>where T: Send,
impl<T: ?Sized> Sync for SimpleMarkerAllocator<T>where T: Sync,
impl<T: ?Sized> Unpin for SimpleMarkerAllocator<T>where T: Unpin,
impl<T: ?Sized> UnwindSafe for SimpleMarkerAllocator<T>where T: UnwindSafe,
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
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere T: Default,
source§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
Tries to create the default.
source§fn unwrap_default() -> Self
fn unwrap_default() -> Self
Calls
try_default
and panics on an error case.