Trait legion::serialize::WorldDeserializer [−][src]
Describes a type which knows how to deserialize the components in a world.
Associated Types
type TypeId: for<'de> Deserialize<'de>
[src]
The stable type ID used to identify each component type in the serialized data.
Required methods
fn unmap_id(
&self,
type_id: &Self::TypeId
) -> Result<ComponentTypeId, UnknownType>
[src]
&self,
type_id: &Self::TypeId
) -> Result<ComponentTypeId, UnknownType>
Converts the serialized type ID into a runtime component type ID.
fn register_component(&self, type_id: Self::TypeId, layout: &mut EntityLayout)
[src]
Adds the specified component to the given entity layout.
fn deserialize_component_slice<'a, 'de, D: Deserializer<'de>>(
&self,
type_id: ComponentTypeId,
storage: UnknownComponentWriter<'a>,
deserializer: D
) -> Result<(), D::Error>
[src]
&self,
type_id: ComponentTypeId,
storage: UnknownComponentWriter<'a>,
deserializer: D
) -> Result<(), D::Error>
Deserializes a slice of components and inserts them into the given storage.
fn deserialize_component<'de, D: Deserializer<'de>>(
&self,
type_id: ComponentTypeId,
deserializer: D
) -> Result<Box<[u8]>, D::Error>
[src]
&self,
type_id: ComponentTypeId,
deserializer: D
) -> Result<Box<[u8]>, D::Error>
Deserializes a single component and returns it as a boxed u8 slice.
Implementors
impl<T> WorldDeserializer for Registry<T> where
T: TypeKey,
[src]
T: TypeKey,
type TypeId = T
fn unmap_id(
&self,
type_id: &Self::TypeId
) -> Result<ComponentTypeId, UnknownType>
[src]
&self,
type_id: &Self::TypeId
) -> Result<ComponentTypeId, UnknownType>
fn register_component(&self, type_id: Self::TypeId, layout: &mut EntityLayout)
[src]
fn deserialize_component_slice<'a, 'de, D: Deserializer<'de>>(
&self,
type_id: ComponentTypeId,
storage: UnknownComponentWriter<'a>,
deserializer: D
) -> Result<(), D::Error>
[src]
&self,
type_id: ComponentTypeId,
storage: UnknownComponentWriter<'a>,
deserializer: D
) -> Result<(), D::Error>
fn deserialize_component<'de, D: Deserializer<'de>>(
&self,
type_id: ComponentTypeId,
deserializer: D
) -> Result<Box<[u8]>, D::Error>
[src]
&self,
type_id: ComponentTypeId,
deserializer: D
) -> Result<Box<[u8]>, D::Error>