Skip to main content

wasm_import

Function wasm_import 

Source
pub(crate) fn wasm_import(attr: TokenStream, item: TokenStream) -> TokenStream
Expand description

Declares a block of JavaScript imports, forwarding this macro’s arguments to #[wasm_bindgen], and implements the wire traits for each type it declares so the type crosses as itself.

A catch import whose parameters need converting is renamed to a hidden __wasm_raw_* import that takes the wire types, and a wrapper with the original signature converts and calls it.