pub trait Rust_Handle_Trait {
fn resize(&self, width: u32, height: u32);
}
#[crate::wasm_bindgen::prelude::wasm_bindgen]
pub struct Rust_Handle_Js {
handle: Rc<dyn Rust_Handle_Trait>,}
impl Rust_Handle_Js {
pub fn new(t: Rc<dyn Rust_Handle_Trait>) -> Rust_Handle_Js {
Rust_Handle_Js { handle: r}}}
#[crate::wasm_bindgen::prelude::wasm_bindgen]
impl Rust_Handle_Js {
#[crate::wasm_bindgen::prelude::wasm_bindgen]
pub fn resize(&self, width: u32, height: u32) {
self.handle.resize(width, height);}}
wasm_bindgen seems to dislike the &self in the pub fn resize
.
Questions:
-
I don't understand what the problem is. The struct itself is
#[wasm_bindgen]
-
How do I get around this issue?