pub struct SimpleMarker<T: ?Sized>(/* private fields */);
Expand description
Basic marker implementation usable for saving and loading, uses u64
as
identifier
Trait Implementations§
Source§impl<T: ?Sized> Clone for SimpleMarker<T>
impl<T: ?Sized> Clone for SimpleMarker<T>
Source§impl<T> Component for SimpleMarker<T>
impl<T> Component for SimpleMarker<T>
Source§type Storage = DenseVecStorage<SimpleMarker<T>>
type Storage = DenseVecStorage<SimpleMarker<T>>
Associated storage type for this component.
Source§impl<T: ?Sized> Debug for SimpleMarker<T>
impl<T: ?Sized> Debug for SimpleMarker<T>
Source§impl<'de, T: ?Sized> Deserialize<'de> for SimpleMarker<T>
impl<'de, T: ?Sized> Deserialize<'de> for SimpleMarker<T>
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<T: ?Sized> Hash for SimpleMarker<T>
impl<T: ?Sized> Hash for SimpleMarker<T>
Source§impl<T> Marker for SimpleMarker<T>
impl<T> Marker for SimpleMarker<T>
Source§type Allocator = SimpleMarkerAllocator<T>
type Allocator = SimpleMarkerAllocator<T>
Allocator for this
Marker
Source§type Identifier = u64
type Identifier = u64
Id of the marker
Source§impl<T> MarkerAllocator<SimpleMarker<T>> for SimpleMarkerAllocator<T>
impl<T> MarkerAllocator<SimpleMarker<T>> for SimpleMarkerAllocator<T>
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 moreSource§impl<T: ?Sized> PartialEq for SimpleMarker<T>
impl<T: ?Sized> PartialEq for SimpleMarker<T>
Source§impl<T: ?Sized> Serialize for SimpleMarker<T>
impl<T: ?Sized> Serialize for SimpleMarker<T>
impl<T: ?Sized> Copy for SimpleMarker<T>
impl<T: ?Sized> Eq for SimpleMarker<T>
Auto Trait Implementations§
impl<T> Freeze for SimpleMarker<T>where
T: ?Sized,
impl<T> RefUnwindSafe for SimpleMarker<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for SimpleMarker<T>
impl<T> Sync for SimpleMarker<T>
impl<T> Unpin for SimpleMarker<T>
impl<T> UnwindSafe for SimpleMarker<T>where
T: UnwindSafe + ?Sized,
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