pub struct U64Marker(_);
Expand description
Basic marker implementation usable for saving and loading
Trait Implementations
sourceimpl Component for U64Marker
impl Component for U64Marker
type Storage = DenseVecStorage<U64Marker>
type Storage = DenseVecStorage<U64Marker>
Associated storage type for this component.
sourceimpl<'de> Deserialize<'de> for U64Marker
impl<'de> Deserialize<'de> for U64Marker
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 Marker for U64Marker
impl Marker for U64Marker
type Allocator = U64MarkerAllocator
type Allocator = U64MarkerAllocator
Allocator for this
Marker
type Identifier = u64
type Identifier = u64
Id of the marker
sourceimpl MarkerAllocator<U64Marker> for U64MarkerAllocator
impl MarkerAllocator<U64Marker> for U64MarkerAllocator
sourcefn allocate(&mut self, entity: Entity, id: Option<u64>) -> U64Marker
fn allocate(&mut self, entity: Entity, id: Option<u64>) -> U64Marker
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 moresourcefn maintain(
&mut self,
entities: &EntitiesRes,
storage: &ReadStorage<'_, U64Marker>
)
fn maintain(
&mut self,
entities: &EntitiesRes,
storage: &ReadStorage<'_, U64Marker>
)
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 moresourceimpl Ord for U64Marker
impl Ord for U64Marker
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<U64Marker> for U64Marker
impl PartialOrd<U64Marker> for U64Marker
sourcefn partial_cmp(&self, other: &U64Marker) -> Option<Ordering>
fn partial_cmp(&self, other: &U64Marker) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for U64Marker
impl Eq for U64Marker
impl StructuralEq for U64Marker
impl StructuralPartialEq for U64Marker
Auto Trait Implementations
impl RefUnwindSafe for U64Marker
impl Send for U64Marker
impl Sync for U64Marker
impl Unpin for U64Marker
impl UnwindSafe for U64Marker
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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<C, M> ConvertSaveload<M> for Cwhere
C: Clone + Serialize + DeserializeOwned,
impl<C, M> ConvertSaveload<M> for Cwhere
C: Clone + Serialize + DeserializeOwned,
type Data = C
type Data = C
(De)Serializable data representation for data type
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 moresourcefn 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