Skip to content

Glossary: Rust Beyond the Basics

Box

Also written: Box<T>, Box::new

A smart pointer that puts one value on the heap; the box itself is just an address. It lets a Vec own mixed types (`Vec<Box<dyn Shippable>>`) and lets a type contain itself.

Where the book teaches it

Related terms

smart pointertrait objectrecursive typeheap