Crates.io | bevy_caravan |
lib.rs | bevy_caravan |
version | 0.1.0 |
source | src |
created_at | 2024-07-17 20:38:40.032855 |
updated_at | 2024-07-17 20:38:40.032855 |
description | A function-like proc macro designed for making expressing Bevy's query.get statements easier. |
homepage | |
repository | https://github.com/orangutanrider/bevy_caravan |
max_upload_size | |
id | 1306584 |
size | 147,352 |
Caravan is a function-like procedural macro built to make expressing query.get statements easier. For this goal, it employs a minature programming language that is written into the function parameters; Example shown below.
ref_caravan!(entity :: query = bindings);
This code would expand into the following:
let Ok(bindings) = query.get(entity) else { return; };
That's the most basic, and expected to be the most common, use-case. The macro has a wide range of additional features, enabling it to be more flexible. Caravan is currently a work in progress but it's primary functions are finished. Documentation is planned but not finished; The best way to understand the macro as of now would be to take a look at the tests that have been written for it: https://github.com/orangutanrider/bevy_caravan/tree/main/tests