-
-
Notifications
You must be signed in to change notification settings - Fork 362
Open
Labels
Description
Is there a reason why we cannot export a tuple struct or tuple to the JS side?
#[napi]
pub fn plus_100(input: u32) -> (u32, u32) {
(input, input)
}
#[napi]
pub struct X(u32, u32);
#[napi]
pub fn plus_200(input: u32) -> X {
X(input, input)
}In the first case, the macro complains:
the trait bound `(u32, u32): NapiRaw` is not satisfied
required because of the requirements on the impl of `napi::bindgen_prelude::ToNapiValue` for `(u32, u32)`
In the second case, the macros don't complain, but on the JS side, I get a X object with no properties...
On the JS side I would be expecting a heterogeneous array of some sort.
Reactions are currently unavailable