Struct specs::saveload::UuidMarkerAllocator
source · pub struct UuidMarkerAllocator { /* private fields */ }
Expand description
Basic marker allocator for uuid.
Implementations§
Trait Implementations§
source§impl Clone for UuidMarkerAllocator
impl Clone for UuidMarkerAllocator
source§fn clone(&self) -> UuidMarkerAllocator
fn clone(&self) -> UuidMarkerAllocator
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for UuidMarkerAllocator
impl Debug for UuidMarkerAllocator
source§impl Default for UuidMarkerAllocator
impl Default for UuidMarkerAllocator
source§impl MarkerAllocator<UuidMarker> for UuidMarkerAllocator
impl MarkerAllocator<UuidMarker> for UuidMarkerAllocator
source§fn allocate(&mut self, entity: Entity, id: Option<Uuid>) -> UuidMarker
fn allocate(&mut self, entity: Entity, id: Option<Uuid>) -> UuidMarker
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: Uuid) -> Option<Entity>
fn retrieve_entity_internal(&self, id: Uuid) -> 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<'_, UuidMarker>
)
fn maintain( &mut self, entities: &EntitiesRes, storage: &ReadStorage<'_, UuidMarker> )
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 RefUnwindSafe for UuidMarkerAllocator
impl Send for UuidMarkerAllocator
impl Sync for UuidMarkerAllocator
impl Unpin for UuidMarkerAllocator
impl UnwindSafe for UuidMarkerAllocator
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.