#[repr(C)]pub struct ecs_query_desc_t {Show 16 fields
pub _canary: i32,
pub filter: ecs_filter_desc_t,
pub order_by_component: u64,
pub order_by: Option<unsafe extern "C" fn(u64, *const c_void, u64, *const c_void) -> i32>,
pub sort_table: Option<unsafe extern "C" fn(*mut ecs_world_t, *mut ecs_table_t, *mut u64, *mut c_void, i32, i32, i32, Option<unsafe extern "C" fn(u64, *const c_void, u64, *const c_void) -> i32>)>,
pub group_by_id: u64,
pub group_by: Option<unsafe extern "C" fn(*mut ecs_world_t, *mut ecs_table_t, u64, *mut c_void) -> u64>,
pub on_group_create: Option<unsafe extern "C" fn(*mut ecs_world_t, u64, *mut c_void) -> *mut c_void>,
pub on_group_delete: Option<unsafe extern "C" fn(*mut ecs_world_t, u64, *mut c_void, *mut c_void)>,
pub group_by_ctx: *mut c_void,
pub group_by_ctx_free: Option<unsafe extern "C" fn(*mut c_void)>,
pub parent: *mut ecs_query_t,
pub ctx: *mut c_void,
pub binding_ctx: *mut c_void,
pub ctx_free: Option<unsafe extern "C" fn(*mut c_void)>,
pub binding_ctx_free: Option<unsafe extern "C" fn(*mut c_void)>,
}Expand description
Used with ecs_query_init.
\ingroup queries
Fields§
§_canary: i32§filter: ecs_filter_desc_tFilter for the query
order_by_component: u64Component to be used by order_by
order_by: Option<unsafe extern "C" fn(u64, *const c_void, u64, *const c_void) -> i32>Callback used for ordering query results. If order_by_id is 0, the pointer provided to the callback will be NULL. If the callback is not set, results will not be ordered.
sort_table: Option<unsafe extern "C" fn(*mut ecs_world_t, *mut ecs_table_t, *mut u64, *mut c_void, i32, i32, i32, Option<unsafe extern "C" fn(u64, *const c_void, u64, *const c_void) -> i32>)>Callback used for ordering query results. Same as order_by, but more efficient.
group_by_id: u64Id to be used by group_by. This id is passed to the group_by function and can be used identify the part of an entity type that should be used for grouping.
group_by: Option<unsafe extern "C" fn(*mut ecs_world_t, *mut ecs_table_t, u64, *mut c_void) -> u64>Callback used for grouping results. If the callback is not set, results will not be grouped. When set, this callback will be used to calculate a “rank” for each entity (table) based on its components. This rank is then used to sort entities (tables), so that entities (tables) of the same rank are “grouped” together when iterated.
on_group_create: Option<unsafe extern "C" fn(*mut ecs_world_t, u64, *mut c_void) -> *mut c_void>Callback that is invoked when a new group is created. The return value of the callback is stored as context for a group.
on_group_delete: Option<unsafe extern "C" fn(*mut ecs_world_t, u64, *mut c_void, *mut c_void)>Callback that is invoked when an existing group is deleted. The return value of the on_group_create callback is passed as context parameter.
group_by_ctx: *mut c_voidContext to pass to group_by
group_by_ctx_free: Option<unsafe extern "C" fn(*mut c_void)>Function to free group_by_ctx
parent: *mut ecs_query_tIf set, the query will be created as a subquery. A subquery matches at most a subset of its parent query. Subqueries do not directly receive (table) notifications from the world. Instead parent queries forward results to subqueries. This can improve matching performance, as fewer queries need to be matched with new tables. Subqueries can be nested.
ctx: *mut c_voidUser context to pass to callback
binding_ctx: *mut c_voidContext to be used for language bindings
ctx_free: Option<unsafe extern "C" fn(*mut c_void)>Callback to free ctx
binding_ctx_free: Option<unsafe extern "C" fn(*mut c_void)>Callback to free binding_ctx
Trait Implementations§
Source§impl Clone for ecs_query_desc_t
impl Clone for ecs_query_desc_t
Source§fn clone(&self) -> ecs_query_desc_t
fn clone(&self) -> ecs_query_desc_t
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more