pub trait CustomEntitySerializer {
    type SerializedID: Serialize + for<'a> Deserialize<'a>;
    fn to_serialized(&self, entity: Entity) -> Self::SerializedID;
fn from_serialized(&self, serialized: Self::SerializedID) -> Entity; }
Expand description

Describes a mapping between a runtime Entity ID and a serialized equivalent.

Implementing this trait will automatically implement EntitySerializer for the type.

Developers should be aware of their serialization/deserialization use-cases as well as world-merge use cases when picking a SerializedID, as this type must identify unique entities across world serialization/deserialization cycles as well as across world merges.

Associated Types

The type used for serialized Entity IDs.

Required methods

Constructs the serializable representation of Entity

Convert a SerializedEntity to an Entity.

Implementors