Attribute Macrosยง
- import_
fn - An attribute macro to convert Rust functions so they can be imported into a runtime.
The meta attributes
nameandscopecan be used to define the scoping of a particular when calling from javascript, for examplescope = "Foo", name = "bar"would assign the function as Foo.bar. Without a scope the function will be attached to the global object, and without a name it will be assigned with the Rust function name.