Reputation: 447
I've got some core functionality, primarily an algorithm that i'm trying to reuse in web assembly and java.
I'm using wasm-bindgen and serde, I notice that wasm-bindgen and serde is tightly coupled to my algorithm via the use of attributes. i.e; #[wasm_bindgen]
and #[derive(Serialize, Deserialize)]
-- i'm quite new to rust so i'm wondering how I can decouple these attributes from my function and struct so that I can reuse my functions and structs in my implementation that will interface with java. At the moment because they're tightly coupled if I was to try and use these functions on a platform that isn't wasm it'll throw a panic.
Upvotes: 0
Views: 171