pub struct UuidMarker { /* private fields */ }
Expand description
Basic marker uuid implementation usable for saving and loading.
Implementations§
Trait Implementations§
Source§impl Clone for UuidMarker
impl Clone for UuidMarker
Source§fn clone(&self) -> UuidMarker
fn clone(&self) -> UuidMarker
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 Component for UuidMarker
impl Component for UuidMarker
Source§type Storage = VecStorage<UuidMarker>
type Storage = VecStorage<UuidMarker>
Associated storage type for this component.
Source§impl Debug for UuidMarker
impl Debug for UuidMarker
Source§impl<'de> Deserialize<'de> for UuidMarker
impl<'de> Deserialize<'de> for UuidMarker
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for UuidMarker
impl Hash for UuidMarker
Source§impl Marker for UuidMarker
impl Marker for UuidMarker
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 moreSource§impl PartialEq for UuidMarker
impl PartialEq for UuidMarker
Source§impl Serialize for UuidMarker
impl Serialize for UuidMarker
impl Eq for UuidMarker
impl StructuralPartialEq for UuidMarker
Auto Trait Implementations§
impl Freeze for UuidMarker
impl RefUnwindSafe for UuidMarker
impl Send for UuidMarker
impl Sync for UuidMarker
impl Unpin for UuidMarker
impl UnwindSafe for UuidMarker
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
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C, M> ConvertSaveload<M> for C
impl<C, M> ConvertSaveload<M> for C
Source§type Error = Infallible
type Error = Infallible
Error may occur during serialization or deserialization of component
Source§fn convert_into<F>(
&self,
_: F,
) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
fn convert_into<F>( &self, _: F, ) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
Convert this data type into serializable form (
Data
) using
entity to marker mapping functionSource§fn convert_from<F>(
data: <C as ConvertSaveload<M>>::Data,
_: F,
) -> Result<C, <C as ConvertSaveload<M>>::Error>
fn convert_from<F>( data: <C as ConvertSaveload<M>>::Data, _: F, ) -> Result<C, <C as ConvertSaveload<M>>::Error>
Convert this data from a deserializable form (
Data
) using
entity to marker mapping functionSource§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more