-
Notifications
You must be signed in to change notification settings - Fork 25
Allow more than 6 parameters in Extern::typed_func #40
Description
Currently FromWasmValueTuple and thus Extern::typed_func only allows up to 6 parameters. This is really limiting, and afaict there's no way to workaround this other than using Extern::func instead.
As a reference point, std implements traits on tuples up to 12:
Due to a temporary restriction in Rust’s type system, the following traits are only implemented on tuples of arity 12 or less. In the future, this may change:
Bevy allows up to 16, but also implements it's trait recursively on tuples implementing those traits allowing nesting of parameters within tuples to allow up to 16^2=256, and another level gives 16^3=4096, and so on.
Edit: for context, I'm reimplementing this function which take 7 i32s, an opaque id and 3 strings as offset and length pairs. I also just noticed the blanket impl for impl TryFrom<WasmValue, Error = ()>, although it doesn't help because it can't map multiple wasm values to a single value.
Edit: ok this is getting a little absurd xD