pub struct SimpleQuery { /* private fields */ }Expand description
Query builder and executable query for SimpleWorld.
SimpleQuery is the preferred query surface for Soroban gameplay loops:
it supports required, excluded, and optional-match components while
selecting the narrowest indexed candidate set available.
Implementations§
Source§impl SimpleQuery
impl SimpleQuery
Sourcepub fn with_component(self, component_type: Symbol) -> Self
pub fn with_component(self, component_type: Symbol) -> Self
Require the entity to have this component.
Sourcepub fn with_components(self, component_types: &[Symbol]) -> Self
pub fn with_components(self, component_types: &[Symbol]) -> Self
Require the entity to have all components from this slice.
Sourcepub fn without_component(self, component_type: Symbol) -> Self
pub fn without_component(self, component_type: Symbol) -> Self
Exclude entities with this component.
Sourcepub fn without_components(self, component_types: &[Symbol]) -> Self
pub fn without_components(self, component_types: &[Symbol]) -> Self
Exclude entities that have any component from this slice.
Sourcepub fn with_any_component(self, component_type: Symbol) -> Self
pub fn with_any_component(self, component_type: Symbol) -> Self
Require the entity to match at least one component from this set.
Sourcepub fn with_any_components(self, component_types: &[Symbol]) -> Self
pub fn with_any_components(self, component_types: &[Symbol]) -> Self
Require the entity to match at least one component from this slice.
Sourcepub fn include_sparse(self) -> Self
pub fn include_sparse(self) -> Self
Include both table and sparse storage during execution.
Sourcepub fn storage(&self) -> QueryStorage
pub fn storage(&self) -> QueryStorage
Returns the current storage mode for the query.
Sourcepub fn execute(&self, world: &SimpleWorld, env: &Env) -> Vec<SimpleEntityId>
pub fn execute(&self, world: &SimpleWorld, env: &Env) -> Vec<SimpleEntityId>
Execute the query against a SimpleWorld.
Sourcepub fn candidate_count(&self, world: &SimpleWorld, env: &Env) -> usize
pub fn candidate_count(&self, world: &SimpleWorld, env: &Env) -> usize
Returns the number of entities that must be scanned before final filtering.
Trait Implementations§
Source§impl Clone for SimpleQuery
impl Clone for SimpleQuery
Source§fn clone(&self) -> SimpleQuery
fn clone(&self) -> SimpleQuery
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SimpleQuery
impl !RefUnwindSafe for SimpleQuery
impl !Send for SimpleQuery
impl !Sync for SimpleQuery
impl Unpin for SimpleQuery
impl UnsafeUnpin for SimpleQuery
impl !UnwindSafe for SimpleQuery
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,
Source§impl<T, U, V, W, E, C> Compare<(T, U, V, W)> for C
impl<T, U, V, W, E, C> Compare<(T, U, V, W)> for C
type Error = E
fn compare( &self, a: &(T, U, V, W), b: &(T, U, V, W), ) -> Result<Ordering, <C as Compare<(T, U, V, W)>>::Error>
Source§impl<T, U, V, W, X, E, C> Compare<(T, U, V, W, X)> for C
impl<T, U, V, W, X, E, C> Compare<(T, U, V, W, X)> for C
type Error = E
fn compare( &self, a: &(T, U, V, W, X), b: &(T, U, V, W, X), ) -> Result<Ordering, <C as Compare<(T, U, V, W, X)>>::Error>
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more