[][src]Trait async_ecs::entity::builder::Builder

pub trait Builder {
    pub fn with<C: Component + Send + Sync>(self, component: C) -> Self;
pub fn build(self) -> Entity; }

A common trait for EntityBuilder and LazyBuilder, allowing either to be used. Entity is definitely alive, but the components may or may not exist before a call to World::maintain.

Required methods

pub fn with<C: Component + Send + Sync>(self, component: C) -> Self[src]

Appends a component and associates it with the entity.

If a component was already associated with the entity, it should overwrite the previous component.

Panics

Panics if the component hasn't been register()ed in the World.

pub fn build(self) -> Entity[src]

Finishes the building and returns the entity.

Loading content...

Implementors

impl<'a> Builder for EntityBuilder<'a>[src]

pub fn with<T: Component>(self, c: T) -> Self[src]

Inserts a component for this entity.

If a component was already associated with the entity, it will overwrite the previous component.

pub fn build(self) -> Entity[src]

Finishes the building and returns the entity. As opposed to LazyBuilder, the components are available immediately.

Loading content...