deno_bindgen
deno_bindgen copied to clipboard
Move the Rust/Deno type mapping into the Rust macro
Currently, the deno_bindgen
macro only records the exported function signatures and changes them to extern "C"
, with the type mapping to Deno's FFI types happening on cli.ts
. This works fine for the time being, while all allowed types are numbers, but it wouldn't really work once #2 is implemented, since you would want a user to be able to use the &str
type rather than having to work unsafely with *const c_char
.
Moving the Rust/Deno type mapping to the macro would also make it possible to show "type not supported" errors highlighted in context, as per usual with rustc.