hecs::Query should handle type parameters
Open
Nobody has claimed this yet.
enhancement
good first issue
help wanted
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 107
- Avg merge
- 2h
- Merged PRs (30d)
- 6
Description
Basically I'd love this to work:
#[derive(hecs::Query)]
pub struct DrawSpriteQuery<'a, SpriteLike = Sprite> {
pub transform: &'a Transform,
pub sprite: &'a SpriteLike,
pub shader_routine: &'a crate::gfx::ShaderRoutine,
pub size: Option<&'a Size>,
}
I'll take a look in the macro to see how tough it would be, but I suspect not terribly difficult, but not sure!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the hecs::Query derive macro and trace how generic parameters on the query struct are parsed and represented. Use the issue's DrawSpriteQuery example as the starting case; done means an equivalent generic query with a default type parameter compiles and derives successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100