Struct empty_box::EmptyBox [] [src]

pub struct EmptyBox<T> { /* fields omitted */ }

An "emptied" Box. Constructed via EmptyBox::take(), an EmptyBox<T> is a Box from which the contents have been moved. This allows for reuse of the Box via EmptyBox::put(), which moves the contents back in, turning the EmptyBox back into a Box<T>.

Methods

impl<T> EmptyBox<T>
[src]

Move the value out of the Box, creating a T and an EmptyBox which preserves the original Box's allocation.

Restore a value to an EmptyBox, creating a new Box and reusing the allocation of whatever Box was destroyed to create the EmptyBox.

Trait Implementations

impl<T> Drop for EmptyBox<T>
[src]

A method called when the value goes out of scope. Read more