Skip to main content

Query

Trait Query 

Source
pub trait Query {
    type Item<'a>;
    type Plan<'w>;

    // Required methods
    fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>;
    fn read<'a, 'w: 'a>(
        plan: &'a mut Self::Plan<'w>,
        row: usize,
    ) -> Self::Item<'a>;
}
Expand description

What to fetch from every entity a query matches.

The type is the query: it says which components to hand out and which archetypes to visit. A query is resolved once per archetype into Query::Plan and then read once per row, so iterating costs one component lookup per archetype rather than one per row.

The impls cover the forms listed in the module documentation, and the crate::query! macro derives this trait for a row of the caller’s own.

Implementing it by hand needs no unsafe: the plan is built through a PlanBuilder, which claims the very columns it hands out.

Required Associated Types§

Source

type Item<'a>

What one matched row yields.

It borrows from the holder that yielded it, never from the world, so an item cannot outlive the claims behind it.

Source

type Plan<'w>

What is resolved once per archetype and then read once per row.

It borrows from the world, so it may keep the columns of the archetype. A row is read through &mut of it, which is what keeps the exclusive references of one read from aliasing those of the next.

Required Methods§

Source

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Resolve the plan for one archetype.

None means the archetype does not match, and the query skips it. Asking the builder for a column the archetype lacks is how a required component narrows the query: builder.read::<T>()?.

Source

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Read the row at row through the resolved plan.

The plan is taken exclusively, so one call reaches at most one exclusive reference per column.

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<Q0: Query, Q1: Query, Q2: Query, Q3: Query, Q4: Query, Q5: Query, Q6: Query, Q7: Query, Q8: Query, Q9: Query, Q10: Query, Q11: Query, Q12: Query, Q13: Query, Q14: Query, Q15: Query> Query for (Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, Q10, Q11, Q12, Q13, Q14, Q15)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>, <Q2 as Query>::Item<'a>, <Q3 as Query>::Item<'a>, <Q4 as Query>::Item<'a>, <Q5 as Query>::Item<'a>, <Q6 as Query>::Item<'a>, <Q7 as Query>::Item<'a>, <Q8 as Query>::Item<'a>, <Q9 as Query>::Item<'a>, <Q10 as Query>::Item<'a>, <Q11 as Query>::Item<'a>, <Q12 as Query>::Item<'a>, <Q13 as Query>::Item<'a>, <Q14 as Query>::Item<'a>, <Q15 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>, <Q2 as Query>::Plan<'w>, <Q3 as Query>::Plan<'w>, <Q4 as Query>::Plan<'w>, <Q5 as Query>::Plan<'w>, <Q6 as Query>::Plan<'w>, <Q7 as Query>::Plan<'w>, <Q8 as Query>::Plan<'w>, <Q9 as Query>::Plan<'w>, <Q10 as Query>::Plan<'w>, <Q11 as Query>::Plan<'w>, <Q12 as Query>::Plan<'w>, <Q13 as Query>::Plan<'w>, <Q14 as Query>::Plan<'w>, <Q15 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query, Q1: Query, Q2: Query, Q3: Query, Q4: Query, Q5: Query, Q6: Query, Q7: Query, Q8: Query, Q9: Query, Q10: Query, Q11: Query, Q12: Query, Q13: Query, Q14: Query> Query for (Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, Q10, Q11, Q12, Q13, Q14)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>, <Q2 as Query>::Item<'a>, <Q3 as Query>::Item<'a>, <Q4 as Query>::Item<'a>, <Q5 as Query>::Item<'a>, <Q6 as Query>::Item<'a>, <Q7 as Query>::Item<'a>, <Q8 as Query>::Item<'a>, <Q9 as Query>::Item<'a>, <Q10 as Query>::Item<'a>, <Q11 as Query>::Item<'a>, <Q12 as Query>::Item<'a>, <Q13 as Query>::Item<'a>, <Q14 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>, <Q2 as Query>::Plan<'w>, <Q3 as Query>::Plan<'w>, <Q4 as Query>::Plan<'w>, <Q5 as Query>::Plan<'w>, <Q6 as Query>::Plan<'w>, <Q7 as Query>::Plan<'w>, <Q8 as Query>::Plan<'w>, <Q9 as Query>::Plan<'w>, <Q10 as Query>::Plan<'w>, <Q11 as Query>::Plan<'w>, <Q12 as Query>::Plan<'w>, <Q13 as Query>::Plan<'w>, <Q14 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query, Q1: Query, Q2: Query, Q3: Query, Q4: Query, Q5: Query, Q6: Query, Q7: Query, Q8: Query, Q9: Query, Q10: Query, Q11: Query, Q12: Query, Q13: Query> Query for (Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, Q10, Q11, Q12, Q13)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>, <Q2 as Query>::Item<'a>, <Q3 as Query>::Item<'a>, <Q4 as Query>::Item<'a>, <Q5 as Query>::Item<'a>, <Q6 as Query>::Item<'a>, <Q7 as Query>::Item<'a>, <Q8 as Query>::Item<'a>, <Q9 as Query>::Item<'a>, <Q10 as Query>::Item<'a>, <Q11 as Query>::Item<'a>, <Q12 as Query>::Item<'a>, <Q13 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>, <Q2 as Query>::Plan<'w>, <Q3 as Query>::Plan<'w>, <Q4 as Query>::Plan<'w>, <Q5 as Query>::Plan<'w>, <Q6 as Query>::Plan<'w>, <Q7 as Query>::Plan<'w>, <Q8 as Query>::Plan<'w>, <Q9 as Query>::Plan<'w>, <Q10 as Query>::Plan<'w>, <Q11 as Query>::Plan<'w>, <Q12 as Query>::Plan<'w>, <Q13 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query, Q1: Query, Q2: Query, Q3: Query, Q4: Query, Q5: Query, Q6: Query, Q7: Query, Q8: Query, Q9: Query, Q10: Query, Q11: Query, Q12: Query> Query for (Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, Q10, Q11, Q12)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>, <Q2 as Query>::Item<'a>, <Q3 as Query>::Item<'a>, <Q4 as Query>::Item<'a>, <Q5 as Query>::Item<'a>, <Q6 as Query>::Item<'a>, <Q7 as Query>::Item<'a>, <Q8 as Query>::Item<'a>, <Q9 as Query>::Item<'a>, <Q10 as Query>::Item<'a>, <Q11 as Query>::Item<'a>, <Q12 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>, <Q2 as Query>::Plan<'w>, <Q3 as Query>::Plan<'w>, <Q4 as Query>::Plan<'w>, <Q5 as Query>::Plan<'w>, <Q6 as Query>::Plan<'w>, <Q7 as Query>::Plan<'w>, <Q8 as Query>::Plan<'w>, <Q9 as Query>::Plan<'w>, <Q10 as Query>::Plan<'w>, <Q11 as Query>::Plan<'w>, <Q12 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query, Q1: Query, Q2: Query, Q3: Query, Q4: Query, Q5: Query, Q6: Query, Q7: Query, Q8: Query, Q9: Query, Q10: Query, Q11: Query> Query for (Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, Q10, Q11)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>, <Q2 as Query>::Item<'a>, <Q3 as Query>::Item<'a>, <Q4 as Query>::Item<'a>, <Q5 as Query>::Item<'a>, <Q6 as Query>::Item<'a>, <Q7 as Query>::Item<'a>, <Q8 as Query>::Item<'a>, <Q9 as Query>::Item<'a>, <Q10 as Query>::Item<'a>, <Q11 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>, <Q2 as Query>::Plan<'w>, <Q3 as Query>::Plan<'w>, <Q4 as Query>::Plan<'w>, <Q5 as Query>::Plan<'w>, <Q6 as Query>::Plan<'w>, <Q7 as Query>::Plan<'w>, <Q8 as Query>::Plan<'w>, <Q9 as Query>::Plan<'w>, <Q10 as Query>::Plan<'w>, <Q11 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query, Q1: Query, Q2: Query, Q3: Query, Q4: Query, Q5: Query, Q6: Query, Q7: Query, Q8: Query, Q9: Query, Q10: Query> Query for (Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, Q10)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>, <Q2 as Query>::Item<'a>, <Q3 as Query>::Item<'a>, <Q4 as Query>::Item<'a>, <Q5 as Query>::Item<'a>, <Q6 as Query>::Item<'a>, <Q7 as Query>::Item<'a>, <Q8 as Query>::Item<'a>, <Q9 as Query>::Item<'a>, <Q10 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>, <Q2 as Query>::Plan<'w>, <Q3 as Query>::Plan<'w>, <Q4 as Query>::Plan<'w>, <Q5 as Query>::Plan<'w>, <Q6 as Query>::Plan<'w>, <Q7 as Query>::Plan<'w>, <Q8 as Query>::Plan<'w>, <Q9 as Query>::Plan<'w>, <Q10 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query, Q1: Query, Q2: Query, Q3: Query, Q4: Query, Q5: Query, Q6: Query, Q7: Query, Q8: Query, Q9: Query> Query for (Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>, <Q2 as Query>::Item<'a>, <Q3 as Query>::Item<'a>, <Q4 as Query>::Item<'a>, <Q5 as Query>::Item<'a>, <Q6 as Query>::Item<'a>, <Q7 as Query>::Item<'a>, <Q8 as Query>::Item<'a>, <Q9 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>, <Q2 as Query>::Plan<'w>, <Q3 as Query>::Plan<'w>, <Q4 as Query>::Plan<'w>, <Q5 as Query>::Plan<'w>, <Q6 as Query>::Plan<'w>, <Q7 as Query>::Plan<'w>, <Q8 as Query>::Plan<'w>, <Q9 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query, Q1: Query, Q2: Query, Q3: Query, Q4: Query, Q5: Query, Q6: Query, Q7: Query, Q8: Query> Query for (Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>, <Q2 as Query>::Item<'a>, <Q3 as Query>::Item<'a>, <Q4 as Query>::Item<'a>, <Q5 as Query>::Item<'a>, <Q6 as Query>::Item<'a>, <Q7 as Query>::Item<'a>, <Q8 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>, <Q2 as Query>::Plan<'w>, <Q3 as Query>::Plan<'w>, <Q4 as Query>::Plan<'w>, <Q5 as Query>::Plan<'w>, <Q6 as Query>::Plan<'w>, <Q7 as Query>::Plan<'w>, <Q8 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query, Q1: Query, Q2: Query, Q3: Query, Q4: Query, Q5: Query, Q6: Query, Q7: Query> Query for (Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>, <Q2 as Query>::Item<'a>, <Q3 as Query>::Item<'a>, <Q4 as Query>::Item<'a>, <Q5 as Query>::Item<'a>, <Q6 as Query>::Item<'a>, <Q7 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>, <Q2 as Query>::Plan<'w>, <Q3 as Query>::Plan<'w>, <Q4 as Query>::Plan<'w>, <Q5 as Query>::Plan<'w>, <Q6 as Query>::Plan<'w>, <Q7 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query, Q1: Query, Q2: Query, Q3: Query, Q4: Query, Q5: Query, Q6: Query> Query for (Q0, Q1, Q2, Q3, Q4, Q5, Q6)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>, <Q2 as Query>::Item<'a>, <Q3 as Query>::Item<'a>, <Q4 as Query>::Item<'a>, <Q5 as Query>::Item<'a>, <Q6 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>, <Q2 as Query>::Plan<'w>, <Q3 as Query>::Plan<'w>, <Q4 as Query>::Plan<'w>, <Q5 as Query>::Plan<'w>, <Q6 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query, Q1: Query, Q2: Query, Q3: Query, Q4: Query, Q5: Query> Query for (Q0, Q1, Q2, Q3, Q4, Q5)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>, <Q2 as Query>::Item<'a>, <Q3 as Query>::Item<'a>, <Q4 as Query>::Item<'a>, <Q5 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>, <Q2 as Query>::Plan<'w>, <Q3 as Query>::Plan<'w>, <Q4 as Query>::Plan<'w>, <Q5 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query, Q1: Query, Q2: Query, Q3: Query, Q4: Query> Query for (Q0, Q1, Q2, Q3, Q4)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>, <Q2 as Query>::Item<'a>, <Q3 as Query>::Item<'a>, <Q4 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>, <Q2 as Query>::Plan<'w>, <Q3 as Query>::Plan<'w>, <Q4 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query, Q1: Query, Q2: Query, Q3: Query> Query for (Q0, Q1, Q2, Q3)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>, <Q2 as Query>::Item<'a>, <Q3 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>, <Q2 as Query>::Plan<'w>, <Q3 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query, Q1: Query, Q2: Query> Query for (Q0, Q1, Q2)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>, <Q2 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>, <Q2 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query, Q1: Query> Query for (Q0, Q1)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>, <Q1 as Query>::Item<'a>)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>, <Q1 as Query>::Plan<'w>)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<Q0: Query> Query for (Q0,)

Asks for every member, yielding a tuple of their items.

Source§

type Item<'a> = (<Q0 as Query>::Item<'a>,)

Source§

type Plan<'w> = (<Q0 as Query>::Plan<'w>,)

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<T: 'static> Query for &T

Asks for T shared.

Source§

type Item<'a> = &'a T

Source§

type Plan<'w> = Col<'w, T>

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<T: 'static> Query for &mut T

Asks for T exclusive.

Source§

type Item<'a> = &'a mut T

Source§

type Plan<'w> = ColMut<'w, T>

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<T: 'static> Query for Option<&T>

Asks for T shared when the archetype carries it.

Source§

type Item<'a> = Option<&'a T>

Source§

type Plan<'w> = Option<Col<'w, T>>

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Source§

impl<T: 'static> Query for Option<&mut T>

Asks for T exclusive when the archetype carries it.

Source§

type Item<'a> = Option<&'a mut T>

Source§

type Plan<'w> = Option<ColMut<'w, T>>

Source§

fn prepare<'w>(builder: &mut PlanBuilder<'w>) -> Option<Self::Plan<'w>>

Source§

fn read<'a, 'w: 'a>(plan: &'a mut Self::Plan<'w>, row: usize) -> Self::Item<'a>

Implementors§

Source§

impl Query for Entity

Asks for the entity itself.

It is an item like any other, so it can be written first, last, or on its own: a query over Entity alone yields every entity the scope sees.

Source§

type Item<'a> = Entity

Source§

type Plan<'w> = &'w [Entity]

Source§

impl<T: 'static> Query for Has<T>

Source§

type Item<'a> = bool

Source§

type Plan<'w> = bool