pub trait QueryComponent {
    type Item<'world>: QueryComponent;

    // Required methods
    fn get_component_ids() -> Vec<ComponentId>;
    fn get_component<'world>(
        world: UnsafeWorldCell<'world>,
        entity_id: EntityId
    ) -> Self::Item<'world>;
}

Required Associated Types§

Required Methods§

source

fn get_component_ids() -> Vec<ComponentId>

source

fn get_component<'world>( world: UnsafeWorldCell<'world>, entity_id: EntityId ) -> Self::Item<'world>

Implementations on Foreign Types§

source§

impl<C> QueryComponent for &mut Cwhere C: Component + 'static,

§

type Item<'world> = &'world mut C

source§

fn get_component_ids() -> Vec<ComponentId>

source§

fn get_component<'world>( world: UnsafeWorldCell<'world>, entity_id: EntityId ) -> Self::Item<'world>

source§

impl<T1> QueryComponent for (T1,)where T1: QueryComponent,

§

type Item<'world> = (<T1 as QueryComponent>::Item<'world>,)

source§

fn get_component_ids() -> Vec<ComponentId>

source§

fn get_component<'world>( world: UnsafeWorldCell<'world>, entity_id: EntityId ) -> Self::Item<'world>

source§

impl<C> QueryComponent for &Cwhere C: Component + 'static,

§

type Item<'world> = &'world C

source§

fn get_component_ids() -> Vec<ComponentId>

source§

fn get_component<'world>( world: UnsafeWorldCell<'world>, entity_id: EntityId ) -> Self::Item<'world>

Implementors§