Add way to skip pub functions in #[wasm_bindgen] impls when generating JS glue.
#[wasm_bindgen]
impl Foo {
#[wasm_bindgen(skip)]
pub fn bar(&self) -> i32 {
7
}
}
Skip pub (crate/self/anything) functions.
You can accomplish this by simply not using #[wasm_bindgen]:
impl Foo {
pub fn bar(&self) -> i32 {
7
}
}
#[wasm_bindgen]
impl Foo {
// functions that you want to send to JS
}
This works because you can have many impl blocks for a single type.
@Pauan ,
Thanks! Closing then.
Most helpful comment
You can accomplish this by simply not using
#[wasm_bindgen]:This works because you can have many
implblocks for a single type.