Trait legion::serialize::CustomEntitySerializer[][src]

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; }

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

type SerializedID: Serialize + for<'a> Deserialize<'a>[src]

The type used for serialized Entity IDs.

Loading content...

Required methods

fn to_serialized(&self, entity: Entity) -> Self::SerializedID[src]

Constructs the serializable representation of Entity

fn from_serialized(&self, serialized: Self::SerializedID) -> Entity[src]

Convert a SerializedEntity to an Entity.

Loading content...

Implementors

impl CustomEntitySerializer for Canon[src]

type SerializedID = Uuid

Loading content...