Skip to content

Add World::query_unchecked #443

Description

@da-shalev

My systems run under a static scheduler, which I'm planning to open source: every system's component accesses are known ahead of time, and only provably disjoint systems ever run together. query()'s dynamic borrow checks can therefore never fail.

Wanted to know what you think about adding World::query_unchecked, so a query can skip the dynamic borrow checks when the caller already guarantees exclusivity.

/// Like `query_mut`, but unchecked.
/// # Safety
/// Caller must guarantee exclusive access to the archetypes `Q` matches.
pub unsafe fn query_unchecked<Q: Query>(&self) -> QueryMut<'_, Q>;

I realize that this is pretty niche. Draft PR: #444

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions