Trait oxygengine_core::ecs::Fetch[][src]

pub unsafe trait Fetch<'a> {
    type Item;
    type State: Copy;
    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: &'a Archetype, state: Self::State) -> Self;
fn release(archetype: &Archetype, state: Self::State);
fn for_each_borrow(f: impl FnMut(TypeId, bool));
unsafe fn get(&self, n: usize) -> Self::Item; }
Expand description

Streaming iterators over contiguous homogeneous ranges of components

Associated Types

Type of value to be fetched

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

Required methods

A value on which get may never be called

How this query will access archetype, if at all

Acquire dynamic borrows from archetype

Look up state for archetype if it should be traversed

Construct a Fetch for archetype based on the associated state

Release dynamic borrows acquired by borrow

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

Access the nth item in this archetype without bounds checking

Safety
  • Must only be called after borrow
  • release must not be called while 'a is still live
  • Bounds-checking must be performed externally
  • Any resulting borrows must be legal (e.g. no &mut to something another iterator might access)

Implementations on Foreign Types

Implementors