Trait oxygengine::prelude::Fetch

pub unsafe trait Fetch: Sized {
    type State: Copy;

    // Required methods
    fn dangling() -> Self;
    fn access(archetype: &Archetype) -> Option<Access>;
    fn borrow(archetype: &Archetype, state: Self::State);
    fn prepare(archetype: &Archetype) -> Option<Self::State>;
    fn execute(archetype: &Archetype, state: Self::State) -> Self;
    fn release(archetype: &Archetype, state: Self::State);
    fn for_each_borrow(f: impl FnMut(TypeId, bool));
}
Expand description

Streaming iterators over contiguous homogeneous ranges of components

Required Associated Types§

type State: Copy

The type of the data which can be cached to speed up retrieving the relevant type states from a matching Archetype

Required Methods§

fn dangling() -> Self

A value on which get may never be called

fn access(archetype: &Archetype) -> Option<Access>

How this query will access archetype, if at all

fn borrow(archetype: &Archetype, state: Self::State)

Acquire dynamic borrows from archetype

fn prepare(archetype: &Archetype) -> Option<Self::State>

Look up state for archetype if it should be traversed

fn execute(archetype: &Archetype, state: Self::State) -> Self

Construct a Fetch for archetype based on the associated state

fn release(archetype: &Archetype, state: Self::State)

Release dynamic borrows acquired by borrow

fn for_each_borrow(f: impl FnMut(TypeId, bool))

Invoke f for every component type that may be borrowed and whether the borrow is unique

Implementations on Foreign Types§

§

impl<C, B, A> Fetch for (C, B, A)where C: Fetch, B: Fetch, A: Fetch,

§

type State = (<C as Fetch>::State, <B as Fetch>::State, <A as Fetch>::State)

§

fn dangling() -> (C, B, A)

§

fn access(archetype: &Archetype) -> Option<Access>

§

fn borrow(archetype: &Archetype, state: <(C, B, A) as Fetch>::State)

§

fn prepare(archetype: &Archetype) -> Option<<(C, B, A) as Fetch>::State>

§

fn execute( archetype: &Archetype, state: <(C, B, A) as Fetch>::State ) -> (C, B, A)

§

fn release(archetype: &Archetype, state: <(C, B, A) as Fetch>::State)

§

fn for_each_borrow(f: impl FnMut(TypeId, bool))

§

impl<H, G, F, E, D, C, B, A> Fetch for (H, G, F, E, D, C, B, A)where H: Fetch, G: Fetch, F: Fetch, E: Fetch, D: Fetch, C: Fetch, B: Fetch, A: Fetch,

§

type State = (<H as Fetch>::State, <G as Fetch>::State, <F as Fetch>::State, <E as Fetch>::State, <D as Fetch>::State, <C as Fetch>::State, <B as Fetch>::State, <A as Fetch>::State)

§

fn dangling() -> (H, G, F, E, D, C, B, A)

§

fn access(archetype: &Archetype) -> Option<Access>

§

fn borrow( archetype: &Archetype, state: <(H, G, F, E, D, C, B, A) as Fetch>::State )

§

fn prepare( archetype: &Archetype ) -> Option<<(H, G, F, E, D, C, B, A) as Fetch>::State>

§

fn execute( archetype: &Archetype, state: <(H, G, F, E, D, C, B, A) as Fetch>::State ) -> (H, G, F, E, D, C, B, A)

§

fn release( archetype: &Archetype, state: <(H, G, F, E, D, C, B, A) as Fetch>::State )

§

fn for_each_borrow(f: impl FnMut(TypeId, bool))

§

impl<I, H, G, F, E, D, C, B, A> Fetch for (I, H, G, F, E, D, C, B, A)where I: Fetch, H: Fetch, G: Fetch, F: Fetch, E: Fetch, D: Fetch, C: Fetch, B: Fetch, A: Fetch,

§

type State = (<I as Fetch>::State, <H as Fetch>::State, <G as Fetch>::State, <F as Fetch>::State, <E as Fetch>::State, <D as Fetch>::State, <C as Fetch>::State, <B as Fetch>::State, <A as Fetch>::State)

§

fn dangling() -> (I, H, G, F, E, D, C, B, A)

§

fn access(archetype: &Archetype) -> Option<Access>

§

fn borrow( archetype: &Archetype, state: <(I, H, G, F, E, D, C, B, A) as Fetch>::State )

§

fn prepare( archetype: &Archetype ) -> Option<<(I, H, G, F, E, D, C, B, A) as Fetch>::State>

§

fn execute( archetype: &Archetype, state: <(I, H, G, F, E, D, C, B, A) as Fetch>::State ) -> (I, H, G, F, E, D, C, B, A)

§

fn release( archetype: &Archetype, state: <(I, H, G, F, E, D, C, B, A) as Fetch>::State )

§

fn for_each_borrow(f: impl FnMut(TypeId, bool))

§

impl Fetch for ()

§

type State = ()

§

fn dangling()

§

fn access(archetype: &Archetype) -> Option<Access>

§

fn borrow(archetype: &Archetype, state: <() as Fetch>::State)

§

fn prepare(archetype: &Archetype) -> Option<<() as Fetch>::State>

§

fn execute(archetype: &Archetype, state: <() as Fetch>::State)

§

fn release(archetype: &Archetype, state: <() as Fetch>::State)

§

fn for_each_borrow(f: impl FnMut(TypeId, bool))

§

impl<J, I, H, G, F, E, D, C, B, A> Fetch for (J, I, H, G, F, E, D, C, B, A)where J: Fetch, I: Fetch, H: Fetch, G: Fetch, F: Fetch, E: Fetch, D: Fetch, C: Fetch, B: Fetch, A: Fetch,

§

impl<K, J, I, H, G, F, E, D, C, B, A> Fetch for (K, J, I, H, G, F, E, D, C, B, A)where K: Fetch, J: Fetch, I: Fetch, H: Fetch, G: Fetch, F: Fetch, E: Fetch, D: Fetch, C: Fetch, B: Fetch, A: Fetch,

§

impl<L, K, J, I, H, G, F, E, D, C, B, A> Fetch for (L, K, J, I, H, G, F, E, D, C, B, A)where L: Fetch, K: Fetch, J: Fetch, I: Fetch, H: Fetch, G: Fetch, F: Fetch, E: Fetch, D: Fetch, C: Fetch, B: Fetch, A: Fetch,

§

impl<A> Fetch for (A,)where A: Fetch,

§

type State = (<A as Fetch>::State,)

§

fn dangling() -> (A,)

§

fn access(archetype: &Archetype) -> Option<Access>

§

fn borrow(archetype: &Archetype, state: <(A,) as Fetch>::State)

§

fn prepare(archetype: &Archetype) -> Option<<(A,) as Fetch>::State>

§

fn execute(archetype: &Archetype, state: <(A,) as Fetch>::State) -> (A,)

§

fn release(archetype: &Archetype, state: <(A,) as Fetch>::State)

§

fn for_each_borrow(f: impl FnMut(TypeId, bool))

§

impl<O, N, M, L, K, J, I, H, G, F, E, D, C, B, A> Fetch for (O, N, M, L, K, J, I, H, G, F, E, D, C, B, A)where O: Fetch, N: Fetch, M: Fetch, L: Fetch, K: Fetch, J: Fetch, I: Fetch, H: Fetch, G: Fetch, F: Fetch, E: Fetch, D: Fetch, C: Fetch, B: Fetch, A: Fetch,

§

impl<B, A> Fetch for (B, A)where B: Fetch, A: Fetch,

§

type State = (<B as Fetch>::State, <A as Fetch>::State)

§

fn dangling() -> (B, A)

§

fn access(archetype: &Archetype) -> Option<Access>

§

fn borrow(archetype: &Archetype, state: <(B, A) as Fetch>::State)

§

fn prepare(archetype: &Archetype) -> Option<<(B, A) as Fetch>::State>

§

fn execute(archetype: &Archetype, state: <(B, A) as Fetch>::State) -> (B, A)

§

fn release(archetype: &Archetype, state: <(B, A) as Fetch>::State)

§

fn for_each_borrow(f: impl FnMut(TypeId, bool))

§

impl<N, M, L, K, J, I, H, G, F, E, D, C, B, A> Fetch for (N, M, L, K, J, I, H, G, F, E, D, C, B, A)where N: Fetch, M: Fetch, L: Fetch, K: Fetch, J: Fetch, I: Fetch, H: Fetch, G: Fetch, F: Fetch, E: Fetch, D: Fetch, C: Fetch, B: Fetch, A: Fetch,

§

impl<E, D, C, B, A> Fetch for (E, D, C, B, A)where E: Fetch, D: Fetch, C: Fetch, B: Fetch, A: Fetch,

§

type State = (<E as Fetch>::State, <D as Fetch>::State, <C as Fetch>::State, <B as Fetch>::State, <A as Fetch>::State)

§

fn dangling() -> (E, D, C, B, A)

§

fn access(archetype: &Archetype) -> Option<Access>

§

fn borrow(archetype: &Archetype, state: <(E, D, C, B, A) as Fetch>::State)

§

fn prepare(archetype: &Archetype) -> Option<<(E, D, C, B, A) as Fetch>::State>

§

fn execute( archetype: &Archetype, state: <(E, D, C, B, A) as Fetch>::State ) -> (E, D, C, B, A)

§

fn release(archetype: &Archetype, state: <(E, D, C, B, A) as Fetch>::State)

§

fn for_each_borrow(f: impl FnMut(TypeId, bool))

§

impl<F, E, D, C, B, A> Fetch for (F, E, D, C, B, A)where F: Fetch, E: Fetch, D: Fetch, C: Fetch, B: Fetch, A: Fetch,

§

type State = (<F as Fetch>::State, <E as Fetch>::State, <D as Fetch>::State, <C as Fetch>::State, <B as Fetch>::State, <A as Fetch>::State)

§

fn dangling() -> (F, E, D, C, B, A)

§

fn access(archetype: &Archetype) -> Option<Access>

§

fn borrow(archetype: &Archetype, state: <(F, E, D, C, B, A) as Fetch>::State)

§

fn prepare( archetype: &Archetype ) -> Option<<(F, E, D, C, B, A) as Fetch>::State>

§

fn execute( archetype: &Archetype, state: <(F, E, D, C, B, A) as Fetch>::State ) -> (F, E, D, C, B, A)

§

fn release(archetype: &Archetype, state: <(F, E, D, C, B, A) as Fetch>::State)

§

fn for_each_borrow(f: impl FnMut(TypeId, bool))

§

impl<M, L, K, J, I, H, G, F, E, D, C, B, A> Fetch for (M, L, K, J, I, H, G, F, E, D, C, B, A)where M: Fetch, L: Fetch, K: Fetch, J: Fetch, I: Fetch, H: Fetch, G: Fetch, F: Fetch, E: Fetch, D: Fetch, C: Fetch, B: Fetch, A: Fetch,

§

impl<D, C, B, A> Fetch for (D, C, B, A)where D: Fetch, C: Fetch, B: Fetch, A: Fetch,

§

type State = (<D as Fetch>::State, <C as Fetch>::State, <B as Fetch>::State, <A as Fetch>::State)

§

fn dangling() -> (D, C, B, A)

§

fn access(archetype: &Archetype) -> Option<Access>

§

fn borrow(archetype: &Archetype, state: <(D, C, B, A) as Fetch>::State)

§

fn prepare(archetype: &Archetype) -> Option<<(D, C, B, A) as Fetch>::State>

§

fn execute( archetype: &Archetype, state: <(D, C, B, A) as Fetch>::State ) -> (D, C, B, A)

§

fn release(archetype: &Archetype, state: <(D, C, B, A) as Fetch>::State)

§

fn for_each_borrow(f: impl FnMut(TypeId, bool))

§

impl<G, F, E, D, C, B, A> Fetch for (G, F, E, D, C, B, A)where G: Fetch, F: Fetch, E: Fetch, D: Fetch, C: Fetch, B: Fetch, A: Fetch,

§

type State = (<G as Fetch>::State, <F as Fetch>::State, <E as Fetch>::State, <D as Fetch>::State, <C as Fetch>::State, <B as Fetch>::State, <A as Fetch>::State)

§

fn dangling() -> (G, F, E, D, C, B, A)

§

fn access(archetype: &Archetype) -> Option<Access>

§

fn borrow(archetype: &Archetype, state: <(G, F, E, D, C, B, A) as Fetch>::State)

§

fn prepare( archetype: &Archetype ) -> Option<<(G, F, E, D, C, B, A) as Fetch>::State>

§

fn execute( archetype: &Archetype, state: <(G, F, E, D, C, B, A) as Fetch>::State ) -> (G, F, E, D, C, B, A)

§

fn release( archetype: &Archetype, state: <(G, F, E, D, C, B, A) as Fetch>::State )

§

fn for_each_borrow(f: impl FnMut(TypeId, bool))

Implementors§