EntityKind

Trait EntityKind 

Source
pub trait EntityKind:
    'static
    + Send
    + Sync {
    type DefaultBundle: Bundle + Default;
    type Bundle: Bundle;

    // Required methods
    unsafe fn from_entity_unchecked(entity: Entity) -> Self;
    fn entity(&self) -> Entity;
}
Expand description

Some kind of an Entity with an expected set of components.

Required Associated Types§

Source

type DefaultBundle: Bundle + Default

A Bundle of components created and inserted by default into all entities with this EntityKind.

Source

type Bundle: Bundle

A Bundle of components inserted into all entities with this EntityKind.

Required Methods§

Source

unsafe fn from_entity_unchecked(entity: Entity) -> Self

Creates a new Entity with this EntityKind.

§Safety

This function assumes entity has all the components associated with this EntityKind.

Source

fn entity(&self) -> Entity

Returns this EntityKind as a generic Entity.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§