pub struct Box<T: ?Sized, S: Storage> { /* private fields */ }
Expand description

A pointer type for heap allocation. A tiny subset of std’s Box.

Implementations

Construct a dynamic storage box from a standard box.

Construct a dynamic storage box inline.

Construct a dynamic storage box by taking someone else’s allocation.

Trait Implementations

The type we point to. This influences which kinds of unsizing are possible. Read more

The output type when unsizing the pointee to U.

Get the raw inner pointer.

Replace the container inner pointer with an unsized version. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert a pointer, as if with unsize coercion. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.