Struct specs::saveload::SimpleMarker
source · [−]#[repr(transparent)]pub struct SimpleMarker<T: ?Sized>(_, _);
Expand description
Basic marker implementation usable for saving and loading, uses u64
as
identifier
Trait Implementations
sourceimpl<T: ?Sized> Clone for SimpleMarker<T>
impl<T: ?Sized> Clone for SimpleMarker<T>
sourceimpl<T> Component for SimpleMarker<T> where
T: 'static + ?Sized + Send + Sync,
impl<T> Component for SimpleMarker<T> where
T: 'static + ?Sized + Send + Sync,
type Storage = DenseVecStorage<SimpleMarker<T>>
type Storage = DenseVecStorage<SimpleMarker<T>>
Associated storage type for this component.
sourceimpl<T: ?Sized> Debug for SimpleMarker<T>
impl<T: ?Sized> Debug for SimpleMarker<T>
sourceimpl<'de, T: ?Sized> Deserialize<'de> for SimpleMarker<T>
impl<'de, T: ?Sized> Deserialize<'de> for SimpleMarker<T>
sourcefn 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
sourceimpl<T: ?Sized> Hash for SimpleMarker<T>
impl<T: ?Sized> Hash for SimpleMarker<T>
sourceimpl<T> Marker for SimpleMarker<T> where
T: 'static + ?Sized + Send + Sync,
impl<T> Marker for SimpleMarker<T> where
T: 'static + ?Sized + Send + Sync,
type Allocator = SimpleMarkerAllocator<T>
type Allocator = SimpleMarkerAllocator<T>
Allocator for this Marker
type Identifier = u64
type Identifier = u64
Id of the marker
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
sourceimpl<T: ?Sized> PartialEq<SimpleMarker<T>> for SimpleMarker<T>
impl<T: ?Sized> PartialEq<SimpleMarker<T>> for SimpleMarker<T>
sourceimpl<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: ?Sized> RefUnwindSafe for SimpleMarker<T> where
T: RefUnwindSafe,
impl<T: ?Sized> Send for SimpleMarker<T> where
T: Send,
impl<T: ?Sized> Sync for SimpleMarker<T> where
T: Sync,
impl<T: ?Sized> Unpin for SimpleMarker<T> where
T: Unpin,
impl<T: ?Sized> UnwindSafe for SimpleMarker<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> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<C, M> ConvertSaveload<M> for C where
C: Clone + Serialize + DeserializeOwned,
impl<C, M> ConvertSaveload<M> for C where
C: Clone + Serialize + DeserializeOwned,
type Data = C
type Data = C
(De)Serializable data representation for data type
type Error = Infallible
type Error = Infallible
Error may occur during serialization or deserialization of component
sourcefn convert_into<F>(
&self,
F
) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error> where
F: FnMut(Entity) -> Option<M>,
fn convert_into<F>(
&self,
F
) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error> where
F: FnMut(Entity) -> Option<M>,
Convert this data type into serializable form (Data
) using
entity to marker mapping function Read more
sourcefn convert_from<F>(
data: <C as ConvertSaveload<M>>::Data,
F
) -> Result<C, <C as ConvertSaveload<M>>::Error> where
F: FnMut(M) -> Option<Entity>,
fn convert_from<F>(
data: <C as ConvertSaveload<M>>::Data,
F
) -> Result<C, <C as ConvertSaveload<M>>::Error> where
F: FnMut(M) -> Option<Entity>,
Convert this data from a deserializable form (Data
) using
entity to marker mapping function Read more