Struct specs::saveload::SimpleMarker [−][src]
#[repr(transparent)]pub struct SimpleMarker<T: ?Sized>(_, _);
Expand description
Basic marker implementation usable for saving and loading, uses u64
as
identifier
Trait Implementations
type Storage = DenseVecStorage<Self>
type Storage = DenseVecStorage<Self>
Associated storage type for this component.
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
type Allocator = SimpleMarkerAllocator<T>
type Allocator = SimpleMarkerAllocator<T>
Allocator for this Marker
type Identifier = u64
type Identifier = u64
Id of the marker
Get this marker internal id. The value of this method should be constant. Read more
impl<T: ?Sized> MarkerAllocator<SimpleMarker<T>> for SimpleMarkerAllocator<T> where
T: 'static + Send + Sync,
[src]
impl<T: ?Sized> MarkerAllocator<SimpleMarker<T>> for SimpleMarkerAllocator<T> where
T: 'static + Send + Sync,
[src]Allocates a new marker for a given entity. If you don’t pass an id, a new unique id will be created. Read more
Get an Entity
by a marker identifier.
This function only accepts an id; it does not update the marker data. Read more
Maintain internal data. Cleanup if necessary.
fn retrieve_entity(
&mut self,
marker: M,
storage: &mut WriteStorage<'_, M>,
entities: &EntitiesRes
) -> Entity
[src]
fn retrieve_entity(
&mut self,
marker: M,
storage: &mut WriteStorage<'_, M>,
entities: &EntitiesRes
) -> Entity
[src]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<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
impl<T> Any for T where
T: Any,
impl<T> Any for T where
T: Any,
pub fn get_type_id(&self) -> TypeId
Mutably borrows from an owned value. Read more
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
pub fn convert_into<F>(
&Self,
F
) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error> where
F: FnMut(Entity) -> Option<M>,
[src]
pub fn convert_into<F>(
&Self,
F
) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error> where
F: FnMut(Entity) -> Option<M>,
[src]Convert this data type into serializable form (Data
) using
entity to marker mapping function Read more
pub fn convert_from<F>(
<C as ConvertSaveload<M>>::Data,
F
) -> Result<C, <C as ConvertSaveload<M>>::Error> where
F: FnMut(M) -> Option<Entity>,
[src]
pub fn convert_from<F>(
<C as ConvertSaveload<M>>::Data,
F
) -> Result<C, <C as ConvertSaveload<M>>::Error> where
F: FnMut(M) -> Option<Entity>,
[src]Convert this data from a deserializable form (Data
) using
entity to marker mapping function Read more