Struct mc_core::entity::DefaultEntityCodec[][src]

pub struct DefaultEntityCodec<T>(_);
Expand description

A useful structure that implements the method EntityCodec::default and add to the given builder the Default:default() value of the generic type T. Actually, EntityCodec is only implemented when your type T is Default + Component. This bound cannot be defined in the structure definition for now because it would not be possible to define it statically.

Implementations

Trait Implementations

Encode components stored accessible from the given entity reference into given destination compound tag. Read more

Decode given source compound tag and add decoded components into the given entity builder.

Add default components to the given entity builder.

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

Performs the conversion.

Performs the conversion.

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.