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