Trait oxygengine_core::ecs::pipeline::Fetch
source · 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§
Required Methods§
sourcefn access(archetype: &Archetype) -> Option<Access>
fn access(archetype: &Archetype) -> Option<Access>
How this query will access archetype
, if at all
sourcefn prepare(archetype: &Archetype) -> Option<Self::State>
fn prepare(archetype: &Archetype) -> Option<Self::State>
Look up state for archetype
if it should be traversed
sourcefn execute(archetype: &Archetype, state: Self::State) -> Self
fn execute(archetype: &Archetype, state: Self::State) -> Self
Construct a Fetch
for archetype
based on the associated state
sourcefn release(archetype: &Archetype, state: Self::State)
fn release(archetype: &Archetype, state: Self::State)
Release dynamic borrows acquired by borrow
sourcefn for_each_borrow(f: impl FnMut(TypeId, bool))
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