How to create a submodule in the rust code? #1379
Unanswered
CMCDragonkai
asked this question in
Q&A
Replies: 1 comment 4 replies
-
you can add #[napi]
pub fn foo() {}
#[napi(js_name = "bar")]
pub mod Bar {
#[napi]
pub fn baz() {}
} |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
If I stick code into Rust modules, then use
mod x
, all of it gets exported at a top level. What's the right way to expose a submodule in JS? So I have to donative.x.f
?Beta Was this translation helpful? Give feedback.
All reactions