Struct specs::saveload::UuidMarker
source · [−]pub struct UuidMarker { /* private fields */ }
Expand description
Basic marker uuid implementation usable for saving and loading.
Implementations
sourceimpl UuidMarker
impl UuidMarker
Trait Implementations
sourceimpl Clone for UuidMarker
impl Clone for UuidMarker
sourcefn clone(&self) -> UuidMarker
fn clone(&self) -> UuidMarker
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 Component for UuidMarker
impl Component for UuidMarker
type Storage = VecStorage<UuidMarker>
type Storage = VecStorage<UuidMarker>
Associated storage type for this component.
sourceimpl Debug for UuidMarker
impl Debug for UuidMarker
sourceimpl<'de> Deserialize<'de> for UuidMarker
impl<'de> Deserialize<'de> for UuidMarker
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 Hash for UuidMarker
impl Hash for UuidMarker
sourceimpl Marker for UuidMarker
impl Marker for UuidMarker
type Allocator = UuidMarkerAllocator
type Allocator = UuidMarkerAllocator
Allocator for this Marker
type Identifier = Uuid
type Identifier = Uuid
Id of the marker
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
sourceimpl PartialEq<UuidMarker> for UuidMarker
impl PartialEq<UuidMarker> for UuidMarker
sourcefn eq(&self, other: &UuidMarker) -> bool
fn eq(&self, other: &UuidMarker) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &UuidMarker) -> bool
fn ne(&self, other: &UuidMarker) -> bool
This method tests for !=
.
sourceimpl Serialize for UuidMarker
impl Serialize for UuidMarker
impl Eq for UuidMarker
impl StructuralEq for UuidMarker
impl StructuralPartialEq for UuidMarker
Auto Trait Implementations
impl RefUnwindSafe for UuidMarker
impl Send for UuidMarker
impl Sync for UuidMarker
impl Unpin for UuidMarker
impl UnwindSafe for UuidMarker
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