Macro gecs::ecs_iter_borrow

source ·
macro_rules! ecs_iter_borrow {
    (...) => { ... };
}
Expand description

Variant of ecs_iter! that runtime-borrows data, for use with a non-mut world reference.

See ecs_iter for more information on find queries.

This version borrows each archetype’s data on a component-by-component basis at runtime rather than at compile-time, allowing for situations where compile-time borrow checking isn’t sufficient. This is typically used for nested queries, where an ecs_iter! or an ecs_find! needs to happen in the body of another query. This operation is backed by std::cell::RefCell operations, and will panic if you attempt to mutably borrow an archetype’s component row while any other borrow is currently active.

Example

See the example for ecs_find_borrow!.