Rust · Class
Box
Box<T> uniquely owns a heap allocation containing T. Create one with Box::new, access its value with *, and let scope-based ownership release it.
Last updated
- Since
- 1.0.0
Syntax
pub struct Box<T, A = Global>(/* private fields */)
pub fn new(x: T) -> Box<T>In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
Box::newBox::downcastBox::into_boxed_sliceBox::into_pinMaybeUninitAny