fable-compiler.github.io
fable-compiler.github.io copied to clipboard
How to import module in Rust?
Hi! i could not find a way to import modules to rust. Is there a way to do this?
Currently a workaround is to inject it into an outer attribute tag like:
[<Fable.Core.Rust.OuterAttr("allow(unused)]\nmod rust_glue;\nmod helpers;\n#[cfg",
[| "target_arch = \"wasm32\"" |])>]
which gives a result like this:
Currently the native Rust imports and bindings are not very user friendly, but something like this should work. Note the imports are wrapped in a dummy local function to make the result a bit less messy.