Trait oxygengine::prelude::pipeline::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§
Required Methods§
fn dangling() -> Self
fn dangling() -> Self
A value on which get
may never be called
fn prepare(archetype: &Archetype) -> Option<Self::State>
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
fn execute(archetype: &Archetype, state: Self::State) -> Self
Construct a Fetch
for archetype
based on the associated state
fn 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