Skip to main content

Entity

Trait Entity 

Source
pub trait Entity: Sealed + 'static { }
Expand description

A heterogeneous list of Components.

Entities are stored within Worlds. In order for an entity to be able to be stored within a World, that World’s Registry must include the Components that make up an entity.

Note that entities must consist of unique component types. Duplicate components are not supported. When multiple components of the same type are included in an entity, a World will only store one of those components.

§Example

use brood::entity;

// Define components.
struct Foo(usize);
struct Bar(bool);

let entity = entity!(Foo(42), Bar(true));

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<Component, Entity> Entity for (Component, Entity)
where Component: Component, Entity: Entity,

Implementors§