Struct specs::saveload::SimpleMarkerAllocator
source · [−]pub struct SimpleMarkerAllocator<T: ?Sized> { /* private fields */ }
Expand description
Basic marker allocator, uses u64
as identifier
Implementations
sourceimpl<T: ?Sized> SimpleMarkerAllocator<T>
impl<T: ?Sized> SimpleMarkerAllocator<T>
Trait Implementations
sourceimpl<T: ?Sized> Clone for SimpleMarkerAllocator<T>
impl<T: ?Sized> Clone for SimpleMarkerAllocator<T>
sourceimpl<T: ?Sized> Debug for SimpleMarkerAllocator<T>
impl<T: ?Sized> Debug for SimpleMarkerAllocator<T>
sourceimpl<T: ?Sized> Default for SimpleMarkerAllocator<T>
impl<T: ?Sized> Default for SimpleMarkerAllocator<T>
sourceimpl<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,
sourcefn 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. Read more
sourcefn 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 more
sourcefn 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.
sourcefn 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 more
Auto 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
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
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> TryDefault for T where
T: Default,
impl<T> TryDefault for T where
T: Default,
sourcefn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
Tries to create the default.
sourcefn unwrap_default() -> Self
fn unwrap_default() -> Self
Calls try_default
and panics on an error case.