pub struct Registry<T> where
    T: TypeKey
{ /* private fields */ }
Expand description

A world (de)serializer which describes how to (de)serialize the component types in a world.

The type parameter T represents the key used in the serialized output to identify each component type. The type keys used must uniquely identify each component type, and be stable between recompiles.

See the legion_typeuuid crate for an example of a type key which is stable between compiles.

Implementations

Constructs a new registry.

Sets the behavior to use when a component type is unknown.

Registers a component type and its key with the registry.

Registers a component type and its key with the registry.

Constructs a serde::DeserializeSeed which will deserialize into an existing world.

Constructs a serde::DeserializeSeed which will deserialize into a new world.

Trait Implementations

Returns the “default value” for a type. Read more

The stable type ID used to identify each component type in the serialized data.

Converts the serialized type ID into a runtime component type ID.

Adds the specified component to the given entity layout.

Deserializes a slice of components and inserts them into the given storage.

Deserializes a single component and returns it as a boxed u8 slice.

The stable type ID used to identify each component type in the serialized data.

Serializes a single component. Read more

Converts a runtime component type ID into the serialized type ID.

Serializes a slice of components. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.