Advanced Export
In this tutorial, we covered the basic exporting features of Ad Astra that should address most practical use cases. However, the export system supports a broader set of features.
To briefly mention a few:
- The export macro supports polymorphic types with type generics, handled through type monomorphization.
- The export macro also supports traits and trait implementations. While the export system does not export traits themselves, it can export implemented members of traits on specified types.
- Exporting custom Rust types (e.g., enums) through type aliases.
- Implementing type casting through the Downcast and Upcast interfaces.
- More script operators, such as implementing the
a = b
assignment operator on a type or a custom field access resolver. - Exporting functions with dynamic parameters and/or result types.
For further reading, refer to the Export macro documentation and the ad_astra::runtime crate module documentation.