https://github.com/locka99/cpp-to-rust-book/blob/master/12_memory_management/index.md?plain=1#L77 provides Rust example with a heap allocation, but it has a caveat.