Trait genesis::Register[][src]

pub trait Register<T> {
    fn register(
        &mut self,
        entity: Entity,
        item: T
    ) -> Result<Option<T>, NoSuchEntity>; }

Type that can be registered. Can be used to set components in ECS Worlds generated by genesis.

Required methods

fn register(
    &mut self,
    entity: Entity,
    item: T
) -> Result<Option<T>, NoSuchEntity>
[src]

Register the given item for the given entity. Returns Err(NoSuchEntity) if the given entity doesn’t exist. Otherwise, returns the previously associated item. For normal components used to generate a World, this is equivalent to calling .set() on the corresponding storage field.

Loading content...

Implementors

Loading content...