[][src]Struct specs::saveload::SimpleMarker

#[repr(transparent)]
pub struct SimpleMarker<T: ?Sized>(_, _);

Basic marker implementation usable for saving and loading, uses u64 as identifier

Trait Implementations

impl<T: ?Sized> Marker for SimpleMarker<T> where
    T: 'static + Send + Sync
[src]

type Allocator = SimpleMarkerAllocator<T>

Allocator for this Marker

type Identifier = u64

Id of the marker

fn update(&mut self, new_revision: Self)[src]

This gets called when an entity is deserialized by DeserializeComponents. It can be used to update internal data that is not used for identification. Read more

impl<T: ?Sized> MarkerAllocator<SimpleMarker<T>> for SimpleMarkerAllocator<T> where
    T: 'static + Send + Sync
[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

fn mark<'m>(
    &mut self,
    entity: Entity,
    storage: &'m mut WriteStorage<M>
) -> Option<(&'m M, bool)>
[src]

Create new unique marker M and attach it to entity. Or get old marker if this entity is already marked. If entity is dead then this will return None. Read more

impl<T: ?Sized> Component for SimpleMarker<T> where
    T: 'static + Send + Sync
[src]

type Storage = DenseVecStorage<Self>

Associated storage type for this component.

impl<T: ?Sized> PartialEq<SimpleMarker<T>> for SimpleMarker<T>[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<T: ?Sized> Copy for SimpleMarker<T>[src]

impl<T: ?Sized> Eq for SimpleMarker<T>[src]

impl<T: ?Sized> Clone for SimpleMarker<T>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: ?Sized> Hash for SimpleMarker<T>[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: ?Sized> Debug for SimpleMarker<T>[src]

impl<T: ?Sized> Serialize for SimpleMarker<T>[src]

impl<'de, T: ?Sized> Deserialize<'de> for SimpleMarker<T>[src]

Auto Trait Implementations

impl<T: ?Sized> Send for SimpleMarker<T> where
    T: Send

impl<T: ?Sized> Unpin for SimpleMarker<T> where
    T: Unpin

impl<T: ?Sized> Sync for SimpleMarker<T> where
    T: Sync

impl<T: ?Sized> UnwindSafe for SimpleMarker<T> where
    T: UnwindSafe

impl<T: ?Sized> RefUnwindSafe for SimpleMarker<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<C, M> ConvertSaveload<M> for C where
    C: Clone + Serialize + DeserializeOwned
[src]

type Data = C

(De)Serializable data representation for data type

type Error = NoError

Error may occur during serialization or deserialization of component

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Resource for T where
    T: Any + Send + Sync
[src]

impl<T> Any for T where
    T: Any
[src]

impl<T> Event for T where
    T: Send + Sync + 'static, 
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]