pub unsafe trait Fetch: Sized + Clone {
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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.