pub struct QueryBuilder<'a, T>where
T: QueryTuple,{ /* private fields */ }
Expand description
Fast to iterate, but slower to create than Filter
Implementations§
Trait Implementations§
Source§impl<'a, T: QueryTuple> QueryBuilderImpl<'a> for QueryBuilder<'a, T>
impl<'a, T: QueryTuple> QueryBuilderImpl<'a> for QueryBuilder<'a, T>
Source§fn query_flags(&mut self, flags: QueryFlags) -> &mut Self
fn query_flags(&mut self, flags: QueryFlags) -> &mut Self
set querylags Read more
Source§fn set_cache_kind(&mut self, kind: QueryCacheKind) -> &mut Self
fn set_cache_kind(&mut self, kind: QueryCacheKind) -> &mut Self
Set what cache method to use for the query Read more
Source§fn set_cached(&mut self) -> &mut Self
fn set_cached(&mut self) -> &mut Self
Set the cache method to cached Read more
Source§fn with<T: ComponentOrPairId>(&mut self) -> &mut Self
fn with<T: ComponentOrPairId>(&mut self) -> &mut Self
set term with type Read more
Source§fn with_enum<T: ComponentId + ComponentType<Enum> + EnumComponentInfo>(
&mut self,
value: T,
) -> &mut Self
fn with_enum<T: ComponentId + ComponentType<Enum> + EnumComponentInfo>( &mut self, value: T, ) -> &mut Self
set term with enum Read more
Source§fn with_enum_wildcard<T: ComponentType<Enum> + ComponentId>(
&mut self,
) -> &mut Self
fn with_enum_wildcard<T: ComponentType<Enum> + ComponentId>( &mut self, ) -> &mut Self
set term with enum wildcard Read more
Source§fn with_first<First: ComponentId>(
&mut self,
second: impl Into<Entity> + Copy,
) -> &mut Self
fn with_first<First: ComponentId>( &mut self, second: impl Into<Entity> + Copy, ) -> &mut Self
set term with pairs Read more
Source§fn with_first_name<First: ComponentId>(&mut self, second: &'a str) -> &mut Self
fn with_first_name<First: ComponentId>(&mut self, second: &'a str) -> &mut Self
set term with pairs Read more
Source§fn with_second<Second: ComponentId>(
&mut self,
first: impl Into<Entity> + Copy,
) -> &mut Self
fn with_second<Second: ComponentId>( &mut self, first: impl Into<Entity> + Copy, ) -> &mut Self
set term with pairs Read more
Source§fn with_second_name<Second: ComponentId>(&mut self, first: &'a str) -> &mut Self
fn with_second_name<Second: ComponentId>(&mut self, first: &'a str) -> &mut Self
set term with pairs Read more
Source§fn with_names(&mut self, first: &'a str, second: &'a str) -> &mut Self
fn with_names(&mut self, first: &'a str, second: &'a str) -> &mut Self
set term with pair names Read more
Source§fn with_first_id(
&mut self,
first: impl Into<Entity>,
second: &'a str,
) -> &mut Self
fn with_first_id( &mut self, first: impl Into<Entity>, second: &'a str, ) -> &mut Self
set term with first id and second name
Source§fn with_second_id(
&mut self,
first: &'a str,
second: impl Into<Entity>,
) -> &mut Self
fn with_second_id( &mut self, first: &'a str, second: impl Into<Entity>, ) -> &mut Self
set term with second id and first name
Source§fn without_id(&mut self, id: impl IntoId) -> &mut Self
fn without_id(&mut self, id: impl IntoId) -> &mut Self
set term without Id Read more
Source§fn without<T: ComponentOrPairId>(&mut self) -> &mut Self
fn without<T: ComponentOrPairId>(&mut self) -> &mut Self
set term without type Read more
Source§fn without_enum<T: ComponentId + ComponentType<Enum> + EnumComponentInfo>(
&mut self,
value: T,
) -> &mut Self
fn without_enum<T: ComponentId + ComponentType<Enum> + EnumComponentInfo>( &mut self, value: T, ) -> &mut Self
set term without enum Read more
Source§fn without_enum_wildcard<T: ComponentId + ComponentType<Enum> + EnumComponentInfo>(
&mut self,
) -> &mut Self
fn without_enum_wildcard<T: ComponentId + ComponentType<Enum> + EnumComponentInfo>( &mut self, ) -> &mut Self
set term without enum wildcard Read more
Source§fn without_first<First: ComponentId>(
&mut self,
second: impl Into<Entity> + Copy,
) -> &mut Self
fn without_first<First: ComponentId>( &mut self, second: impl Into<Entity> + Copy, ) -> &mut Self
set term without pairs Read more
Source§fn without_first_name<First: ComponentId>(
&mut self,
second: &'a str,
) -> &mut Self
fn without_first_name<First: ComponentId>( &mut self, second: &'a str, ) -> &mut Self
set term without pairs Read more
Source§fn without_second<Second: ComponentId>(
&mut self,
first: impl Into<Entity> + Copy,
) -> &mut Self
fn without_second<Second: ComponentId>( &mut self, first: impl Into<Entity> + Copy, ) -> &mut Self
set term without pairs Read more
Source§fn without_second_name<Second: ComponentId>(
&mut self,
first: &'a str,
) -> &mut Self
fn without_second_name<Second: ComponentId>( &mut self, first: &'a str, ) -> &mut Self
set term without pairs Read more
Source§fn without_name(&mut self, name: &'a str) -> &mut Self
fn without_name(&mut self, name: &'a str) -> &mut Self
set term without Name Read more
Source§fn without_names(&mut self, first: &'a str, second: &'a str) -> &mut Self
fn without_names(&mut self, first: &'a str, second: &'a str) -> &mut Self
set term without pair names Read more
Source§fn without_first_id(
&mut self,
first: impl Into<Entity>,
second: &'a str,
) -> &mut Self
fn without_first_id( &mut self, first: impl Into<Entity>, second: &'a str, ) -> &mut Self
set term without first id and second name Read more
Source§fn without_second_id(
&mut self,
first: &'a str,
second: impl Into<Entity>,
) -> &mut Self
fn without_second_id( &mut self, first: &'a str, second: impl Into<Entity>, ) -> &mut Self
set term without second id and first name Read more
Source§fn term_at(&mut self, index: u32) -> &mut Self
fn term_at(&mut self, index: u32) -> &mut Self
Term notation for more complex query features Read more
Source§fn write<T: ComponentOrPairId>(&mut self) -> &mut Self
fn write<T: ComponentOrPairId>(&mut self) -> &mut Self
Set the type as current term and in mode out
Source§fn write_id(&mut self, id: impl IntoId) -> &mut Self
fn write_id(&mut self, id: impl IntoId) -> &mut Self
Set the id as current term and in mode out
Source§fn write_name(&mut self, name: &'a str) -> &mut Self
fn write_name(&mut self, name: &'a str) -> &mut Self
Set the name as current term and in mode out
Source§fn write_names(&mut self, first: &'a str, second: &'a str) -> &mut Self
fn write_names(&mut self, first: &'a str, second: &'a str) -> &mut Self
Set the names as current term and in mode out
Source§fn write_enum<T: ComponentId + ComponentType<Enum> + EnumComponentInfo>(
&mut self,
value: T,
) -> &mut Self
fn write_enum<T: ComponentId + ComponentType<Enum> + EnumComponentInfo>( &mut self, value: T, ) -> &mut Self
Set the type as current term and in mode out
Source§fn write_first<T: ComponentId>(
&mut self,
second: impl Into<Entity> + Copy,
) -> &mut Self
fn write_first<T: ComponentId>( &mut self, second: impl Into<Entity> + Copy, ) -> &mut Self
Set the relationship as current term and in mode out
Source§fn write_first_name<T: ComponentId>(&mut self, second: &'a str) -> &mut Self
fn write_first_name<T: ComponentId>(&mut self, second: &'a str) -> &mut Self
Set the relationship as current term and in mode out
Source§fn write_second<T: ComponentId>(
&mut self,
first: impl Into<Entity> + Copy,
) -> &mut Self
fn write_second<T: ComponentId>( &mut self, first: impl Into<Entity> + Copy, ) -> &mut Self
Set the relationship as current term and in mode out
Source§fn write_second_name<T: ComponentId>(&mut self, first: &'a str) -> &mut Self
fn write_second_name<T: ComponentId>(&mut self, first: &'a str) -> &mut Self
Set the relationship as current term and in mode out
Source§fn read<T: ComponentOrPairId>(&mut self) -> &mut Self
fn read<T: ComponentOrPairId>(&mut self) -> &mut Self
Set the type as current term and in mode in
Source§fn read_name(&mut self, name: &'a str) -> &mut Self
fn read_name(&mut self, name: &'a str) -> &mut Self
Set the name as current term and in mode in
Source§fn read_names(&mut self, first: &'a str, second: &'a str) -> &mut Self
fn read_names(&mut self, first: &'a str, second: &'a str) -> &mut Self
Set the names as current term and in mode in
Source§fn read_enum<T: ComponentId + ComponentType<Enum> + EnumComponentInfo>(
&mut self,
value: T,
) -> &mut Self
fn read_enum<T: ComponentId + ComponentType<Enum> + EnumComponentInfo>( &mut self, value: T, ) -> &mut Self
Set the type as current term and in mode in
Source§fn read_first<T: ComponentId>(
&mut self,
second: impl Into<Entity> + Copy,
) -> &mut Self
fn read_first<T: ComponentId>( &mut self, second: impl Into<Entity> + Copy, ) -> &mut Self
Set the relationship as current term and in mode in
Source§fn read_first_name<T: ComponentId>(&mut self, second: &'a str) -> &mut Self
fn read_first_name<T: ComponentId>(&mut self, second: &'a str) -> &mut Self
Set the relationship as current term and in mode in
Source§fn read_second<T: ComponentId>(
&mut self,
first: impl Into<Entity> + Copy,
) -> &mut Self
fn read_second<T: ComponentId>( &mut self, first: impl Into<Entity> + Copy, ) -> &mut Self
Set the relationship as current term and in mode in
Source§fn read_second_name<T: ComponentId>(&mut self, first: &'a str) -> &mut Self
fn read_second_name<T: ComponentId>(&mut self, first: &'a str) -> &mut Self
Set the relationship as current term and in mode in
Source§fn scope_open(&mut self) -> &mut Self
fn scope_open(&mut self) -> &mut Self
Open a scope for the query
Source§fn scope_close(&mut self) -> &mut Self
fn scope_close(&mut self) -> &mut Self
Close a scope for the query
Source§fn order_by<T>(&mut self, compare: impl OrderByFn<T>) -> &mut Selfwhere
T: ComponentId,
Self: QueryBuilderImpl<'a>,
fn order_by<T>(&mut self, compare: impl OrderByFn<T>) -> &mut Selfwhere
T: ComponentId,
Self: QueryBuilderImpl<'a>,
Sorts the output of a query. Read more
Source§fn order_by_id(
&mut self,
component: impl Into<Entity>,
compare: impl OrderByFnVoid,
) -> &mut Self
fn order_by_id( &mut self, component: impl Into<Entity>, compare: impl OrderByFnVoid, ) -> &mut Self
Sorts the output of a query. Read more
Source§fn group_by<T>(&mut self) -> &mut Selfwhere
T: ComponentId,
fn group_by<T>(&mut self) -> &mut Selfwhere
T: ComponentId,
Group and sort matched tables. Read more
Source§fn group_by_fn<T>(
&mut self,
group_by_action: ecs_group_by_action_t,
) -> &mut Selfwhere
T: ComponentId,
fn group_by_fn<T>(
&mut self,
group_by_action: ecs_group_by_action_t,
) -> &mut Selfwhere
T: ComponentId,
Group and sort matched tables. Read more
Source§fn group_by_id_fn(
&mut self,
component: impl Into<Entity>,
group_by_action: ecs_group_by_action_t,
) -> &mut Self
fn group_by_id_fn( &mut self, component: impl Into<Entity>, group_by_action: ecs_group_by_action_t, ) -> &mut Self
Group and sort matched tables. Read more
Source§fn group_by_id(&mut self, component: impl Into<Entity>) -> &mut Self
fn group_by_id(&mut self, component: impl Into<Entity>) -> &mut Self
Group and sort matched tables. Read more
Source§fn group_by_ctx(
&mut self,
ctx: *mut c_void,
ctx_free: ecs_ctx_free_t,
) -> &mut Self
fn group_by_ctx( &mut self, ctx: *mut c_void, ctx_free: ecs_ctx_free_t, ) -> &mut Self
Specify context to be passed to the
group_by
function. Read moreSource§fn on_group_create(&mut self, action: ecs_group_create_action_t) -> &mut Self
fn on_group_create(&mut self, action: ecs_group_create_action_t) -> &mut Self
Specify the
on_group_create
action. Read moreSource§fn on_group_delete(&mut self, action: ecs_group_delete_action_t) -> &mut Self
fn on_group_delete(&mut self, action: ecs_group_delete_action_t) -> &mut Self
Specify the
on_group_delete
action. Read moreSource§impl<'a, T: QueryTuple> TermBuilderImpl<'a> for QueryBuilder<'a, T>
impl<'a, T: QueryTuple> TermBuilderImpl<'a> for QueryBuilder<'a, T>
Source§fn init_current_term<T>(&mut self, id: T)where
T: IntoId,
fn init_current_term<T>(&mut self, id: T)where
T: IntoId,
initializes a new term from a id of a component or pair Read more
Source§fn init_term_from<T: ComponentOrPairId>(&mut self)
fn init_term_from<T: ComponentOrPairId>(&mut self)
initialize a new term from a component or pair Read more
Source§fn self_(&mut self) -> &mut Self
fn self_(&mut self) -> &mut Self
The self flag indicates the term identifier itself is used Read more
Source§fn set_id(&mut self, id: impl Into<Entity>) -> &mut Self
fn set_id(&mut self, id: impl Into<Entity>) -> &mut Self
Specify value of identifier by id, same as
id()
of the current term set Read moreSource§fn entity(&mut self, entity: impl Into<Entity>) -> &mut Self
fn entity(&mut self, entity: impl Into<Entity>) -> &mut Self
Specify value of identifier by id. Almost the same as id(entity), but this
operation explicitly sets the
flecs::IsEntity
flag. This forces the id to
be interpreted as entity, whereas not setting the flag would implicitly
convert ids for builtin variables such as flecs::This
to a variable. Read moreSource§fn set_var(&mut self, var_name: &'a str) -> &mut Self
fn set_var(&mut self, var_name: &'a str) -> &mut Self
Specify identifier is a variable (resolved at query evaluation time) Read more
Source§fn first(&mut self) -> &mut Self
fn first(&mut self) -> &mut Self
Call prior to setting values for first identifier. This is either the
component identifier, or first element of a pair (in case second is
populated as well). Read more
Source§fn second(&mut self) -> &mut Self
fn second(&mut self) -> &mut Self
Call prior to setting values for second identifier. This is the second
element of a pair. Requires that
first()
is populated as well. Read moreSource§fn set_src_id(&mut self, id: impl Into<Entity>) -> &mut Self
fn set_src_id(&mut self, id: impl Into<Entity>) -> &mut Self
Select src identifier, initialize it with entity id Read more
Source§fn set_src<T: ComponentId>(&mut self) -> &mut Self
fn set_src<T: ComponentId>(&mut self) -> &mut Self
Select src identifier, initialize it with id associated with type Read more
Source§fn set_src_name(&mut self, name: &'a str) -> &mut Self
fn set_src_name(&mut self, name: &'a str) -> &mut Self
Select src identifier, initialize it with name. If name starts with a $
the name is interpreted as a variable. Read more
Source§fn set_first_id(&mut self, id: impl Into<Entity>) -> &mut Self
fn set_first_id(&mut self, id: impl Into<Entity>) -> &mut Self
Select first identifier, initialize it with entity id Read more
Source§fn set_first<T: ComponentId>(&mut self) -> &mut Self
fn set_first<T: ComponentId>(&mut self) -> &mut Self
Select first identifier, initialize it with id associated with type Read more
Source§fn set_first_name(&mut self, name: &'a str) -> &mut Self
fn set_first_name(&mut self, name: &'a str) -> &mut Self
Select first identifier, initialize it with name. If name starts with a $
the name is interpreted as a variable. Read more
Source§fn set_second_id(&mut self, id: impl Into<Entity>) -> &mut Self
fn set_second_id(&mut self, id: impl Into<Entity>) -> &mut Self
Select second identifier, initialize it with entity id Read more
Source§fn set_second<T: ComponentId>(&mut self) -> &mut Self
fn set_second<T: ComponentId>(&mut self) -> &mut Self
Select second identifier, initialize it with id associated with type Read more
Source§fn set_second_name(&mut self, name: &'a str) -> &mut Self
fn set_second_name(&mut self, name: &'a str) -> &mut Self
Select second identifier, initialize it with name. If name starts with a $
the name is interpreted as a variable. Read more
Source§fn up(&mut self) -> &mut Self
fn up(&mut self) -> &mut Self
default up where trav is set to 0.
The up flag indicates that the term identifier may be substituted by
traversing a relationship upwards. For example: substitute the identifier
with its parent by traversing the
ChildOf
relationship. Read moreSource§fn up_id(&mut self, traverse_relationship: impl Into<Entity>) -> &mut Self
fn up_id(&mut self, traverse_relationship: impl Into<Entity>) -> &mut Self
The up flag indicates that the term identifier may be substituted by
traversing a relationship upwards. For example: substitute the identifier
with its parent by traversing the
ChildOf
relationship. Read moreSource§fn up_type<TravRel: ComponentId>(&mut self) -> &mut Self
fn up_type<TravRel: ComponentId>(&mut self) -> &mut Self
The up flag indicates that the term identifier may be substituted by
traversing a relationship upwards. For example: substitute the identifier
with its parent by traversing the
ChildOf
relationship. Read moreSource§fn cascade(&mut self) -> &mut Self
fn cascade(&mut self) -> &mut Self
Cascade iterates a hierarchy in top to bottom order (breadth first search)
The cascade flag is like up, but returns results in breadth-first order.
Only supported for
flecs::query
. Read moreSource§fn cascade_id(&mut self, traverse_relationship: impl Into<Entity>) -> &mut Self
fn cascade_id(&mut self, traverse_relationship: impl Into<Entity>) -> &mut Self
Cascade iterates a hierarchy in top to bottom order (breadth first search)
The cascade flag is like up, but returns results in breadth-first order.
Only supported for
flecs::query
Read moreSource§fn cascade_type<TravRel: ComponentId>(&mut self) -> &mut Self
fn cascade_type<TravRel: ComponentId>(&mut self) -> &mut Self
Cascade iterates a hierarchy in top to bottom order (breadth first search)
The cascade flag is like up, but returns results in breadth-first order.
Only supported for
flecs::query
Read moreSource§fn desc(&mut self) -> &mut Self
fn desc(&mut self) -> &mut Self
Use with cascade to iterate results in descending (bottom + top) order.
Source§fn trav(
&mut self,
traverse_relationship: impl Into<Entity>,
flags: u64,
) -> &mut Self
fn trav( &mut self, traverse_relationship: impl Into<Entity>, flags: u64, ) -> &mut Self
Specify relationship to traverse, and flags to indicate direction Read more
Source§fn set_inout_kind(&mut self, inout: InOutKind) -> &mut Self
fn set_inout_kind(&mut self, inout: InOutKind) -> &mut Self
Set read/write access of term Read more
Source§fn inout_stage(&mut self, inout: InOutKind) -> &mut Self
fn inout_stage(&mut self, inout: InOutKind) -> &mut Self
Set read/write access for stage. Use this when a system reads or writes
components other than the ones provided by the query. This information
can be used by schedulers to insert sync/merge points between systems
where deferred operations are flushed. Read more
Source§fn write_curr(&mut self) -> &mut Self
fn write_curr(&mut self) -> &mut Self
Set write mode on current term.
Short for
inout_stage(InOutKind::Out)
.
Use when system uses add, remove or set. Read moreSource§fn read_curr(&mut self) -> &mut Self
fn read_curr(&mut self) -> &mut Self
Set read mode on current term.
Short for
inout_stage(InOutKind::In)
.
Use when system uses get Read moreSource§fn read_write(&mut self) -> &mut Self
fn read_write(&mut self) -> &mut Self
Source§fn set_inout_none(&mut self) -> &mut Self
fn set_inout_none(&mut self) -> &mut Self
short for
set_inout(InOutKind::None)
Read moreSource§impl<'a, T: QueryTuple> WorldProvider<'a> for QueryBuilder<'a, T>
impl<'a, T: QueryTuple> WorldProvider<'a> for QueryBuilder<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for QueryBuilder<'a, T>
impl<'a, T> RefUnwindSafe for QueryBuilder<'a, T>where
T: RefUnwindSafe,
impl<'a, T> !Send for QueryBuilder<'a, T>
impl<'a, T> !Sync for QueryBuilder<'a, T>
impl<'a, T> Unpin for QueryBuilder<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for QueryBuilder<'a, T>where
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more