smart pointer in Rust

Rust allocates everything on the stack by default. You can store things on the heap by wrapping them in smart pointers like Box.