kepler icon indicating copy to clipboard operation
kepler copied to clipboard

Propigate class constraints for Query handlers from Application

Open UnitylChaos opened this issue 4 years ago • 2 comments

General case of #256

It would be better to enforce these constraints when the Module or Query handler is built, rather than just when makeApp is called.

Based on my very light reading, it looks like at a minimum:

  • A StoreLeaf query of type Map requires QueryData on the Key type.
  • A general Leaf query requires HasCodec on the type being returned. (perhaps this could be enforced through a constraint in the QueryResult type?)

UnitylChaos avatar Jan 12 '21 01:01 UnitylChaos

Yes this makes sense, I can look into this. I’m out of the office/ open source works for the next week, but will accept any pr that fixes it done before then

martyall avatar Jan 12 '21 04:01 martyall

I was thinking about this, I think we can make a smart constructor for constructing a module and not expose the constructor directly. I will try to make a PR

martyall avatar Jan 21 '21 17:01 martyall