projectmoon 001da3ca2f Remove boxed dyn requirement on GBNF Limits.
This commit removes the use of dynamic dispatch for GBNF rule limits
by making use of some overly complicated generic trait bounds plus
associated types, along with two new types. Instead of wrapping GBNF
limits in a box dynamic trait object that produces GBNF limits, there
are two types: GbnfLimitedPrimitive and GbnfLimitedComplex.

These types contain the actual (not very complicated) logic to convert
their contained limit-values into the GBNF limits, which then get
converted to actual limits in the GBNF grammar. This removes heap
allocation and dynamic dispatch, as well as making creation of limit
objects more ergonomic.
2024-03-27 11:10:59 +01:00
src Remove boxed dyn requirement on GBNF Limits. 2024-03-27 11:10:59 +01:00
Cargo.toml Allow limiting of values on derive(Gbnf) structs. 2024-03-05 20:28:00 +01:00