pub(crate) enum ScopeSummary {
Empty,
Uniform(Entity),
Mixed,
}Expand description
Which scopes an archetype’s rows live in, as far as a whole-archetype gate can tell.
A derived summary, not part of the archetype’s identity: it is counted from the scope each row was pushed with, and the gates below are the only thing that uses it. Both gates are conservative in the same direction: they never accept a row that the per-row check would reject.
Variants§
Empty
No rows.
Uniform(Entity)
Every row lives in this scope.
Mixed
Rows live in more than one scope.
Implementations§
Source§impl ScopeSummary
impl ScopeSummary
Sourcepub(crate) fn any_visible(self, world: &World, caller: Entity) -> bool
pub(crate) fn any_visible(self, world: &World, caller: Entity) -> bool
Whether at least one row of the archetype is visible from caller.
This is the gate a query applies before it visits any row. A uniform
archetype is either entirely visible or has exactly one visible row: the
caller’s own entity, which lives in caller’s parent scope and so sits
in that parent’s uniform archetype.
Sourcepub(crate) fn all_visible(self, world: &World, caller: Entity) -> bool
pub(crate) fn all_visible(self, world: &World, caller: Entity) -> bool
Whether every row of the archetype is visible from caller.
Vacuously true for an empty archetype, which is why the callers that hand out rows also require the archetype to be non-empty.
Sourcepub(crate) fn row_visible(
self,
archetype: &Archetype,
world: &World,
caller: Entity,
row: usize,
) -> bool
pub(crate) fn row_visible( self, archetype: &Archetype, world: &World, caller: Entity, row: usize, ) -> bool
Whether row row of archetype is visible from caller.
The per-row answer for a summary a whole-archetype gate could not decide. The caller’s own row is always visible: a scope sees the entity it is rooted at, and that entity lives in the scope’s parent.
Trait Implementations§
Source§impl Clone for ScopeSummary
impl Clone for ScopeSummary
impl Copy for ScopeSummary
Source§impl Debug for ScopeSummary
impl Debug for ScopeSummary
Source§impl Default for ScopeSummary
impl Default for ScopeSummary
impl Eq for ScopeSummary
Source§impl PartialEq for ScopeSummary
impl PartialEq for ScopeSummary
impl StructuralPartialEq for ScopeSummary
Auto Trait Implementations§
impl Forget for ScopeSummary
impl Freeze for ScopeSummary
impl RefUnwindSafe for ScopeSummary
impl Send for ScopeSummary
impl Sync for ScopeSummary
impl Unpin for ScopeSummary
impl UnsafeUnpin for ScopeSummary
impl UnwindSafe for ScopeSummary
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Component for Twhere
T: 'static,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.