Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
The Rust macro include_str includes a UTF-8 encoded file as a string; the Rust macro include_bytes includes a file as a reference to a byte array. Both of those 2 macros load files into the Rust binary at compile time and consume memory at run time. It might not be a good idea to use them for large files!
Rustdef Makes It Dead Simple to Call Rust in Python Notebook
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Tips and Traps¶
- rustimport is a Python library which allows you to import Rust source files directly from Python! It is similar to rustdef @ GitHub but targeting use cases in Python code instead of in Jupyter/Lab notebooks.
Lua Bindings for Rust
Pointer, Reference and Ownership in Rust
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Tips and Traps¶
- You should avoid using lifetime annotation as much as possible especially in public APIs. Leveraging smart pointers is a good approach to elide lifetime annotations. For more discussions on this, please refer to Smart pointers: The secret to write clean Rust code
Webassembly as An Alternative to Containers
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Global Data in Rust
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
The GitHub repository global-data-in-rust has a guide explaining how to use "global data" in Rust.