Trait ComponentQuery

Source
pub trait ComponentQuery {
    type Item<'t>;
    type State<'s>: QueryState<'s>;

    // Required method
    fn query<'t, 's>(
        tiles: &'t Tiles,
        tile: Tile,
        state: Self::State<'s>,
    ) -> Option<Self::Item<'t>>;
}

Required Associated Types§

Source

type Item<'t>

Source

type State<'s>: QueryState<'s>

Required Methods§

Source

fn query<'t, 's>( tiles: &'t Tiles, tile: Tile, state: Self::State<'s>, ) -> Option<Self::Item<'t>>

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.

Implementations on Foreign Types§

Source§

impl<'a, T: TileComponent> ComponentQuery for &'a T

Source§

type Item<'t> = &'t T

Source§

type State<'s> = EphemeralQueryState<'s>

Source§

fn query<'t, 's>( tiles: &'t Tiles, tile: Tile, _state: Self::State<'s>, ) -> Option<Self::Item<'t>>

Source§

impl<CQ1: ComponentQuery, CQ2: ComponentQuery> ComponentQuery for (CQ1, CQ2)

Source§

type Item<'t> = (<CQ1 as ComponentQuery>::Item<'t>, <CQ2 as ComponentQuery>::Item<'t>)

Source§

type State<'s> = EphemeralQueryState<'s>

Source§

fn query<'t, 's>( tiles: &'t Tiles, tile: Tile, state: Self::State<'s>, ) -> Option<Self::Item<'t>>

Implementors§