Skip to main content

ecs_query_desc_t

Struct ecs_query_desc_t 

Source
#[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_t

Filter for the query

§order_by_component: u64

Component 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: u64

Id 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_void

Context 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_t

If 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_void

User context to pass to callback

§binding_ctx: *mut c_void

Context 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

Source§

fn clone(&self) -> ecs_query_desc_t

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ecs_query_desc_t

Source§

impl Debug for ecs_query_desc_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Component for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.