macro_rules! with {
($entity:ty) => { ... };
($entity:ty, $($prop:expr),+ $(,)?) => { ... };
}Expand description
Creates a query matching all entities of a given type, optionally filtered by properties.
§Examples
ⓘ
// Add an entity with default properties
let query = with!(Person);
context.add_entity(query)?;
// An inline query matching a single property
let person = context.sample_entity(MyRng, with!(Person, Age(12)))?;
// A query matching multiple properties
let query = with!(Person, Age(12), RiskCategory::High);
let count = context.count_entities(query);