Struct boxed::Box [] [src]

#[lang = "owned_box"]
pub struct Box<T: ?Sized, A: Alloc> { /* fields omitted */ }

Pointer to heap-allocated value

Methods

impl<T, A: Alloc> Box<T, A>
[src]

[src]

impl<T, A: Alloc + Default> Box<T, A>
[src]

[src]

Allocate memory on the heap and then move x into it.

impl<T: ?Sized, A: Alloc> Box<T, A>
[src]

[src]

Make a Box of a raw pointer. After calling this, the Box it returns owns the raw pointer. This means the Box destructor will drop the T and free the memory. As allocation technique of Box is unspecified, the only valid argument to this is Box::into_raw(_).

[src]

Consume a Box and return its raw pointer. The caller owns the memory the Box owned. This means the caller must make sure the T is dropped and the memory is deallocated. The proper way to do so is to call Box::from_raw to make a new Box of the pointer.

impl<T: ?Sized, A: Alloc + Default> Box<T, A>
[src]

[src]

Make a Box of a raw pointer. After calling this, the Box it returns owns the raw pointer. This means the Box destructor will drop the T and free the memory. As allocation technique of Box is unspecified, the only valid argument to this is Box::into_raw(_).

Trait Implementations

impl<T: ?Sized, A: Alloc> Deref for Box<T, A>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl<T: ?Sized, A: Alloc> DerefMut for Box<T, A>
[src]

[src]

Mutably dereferences the value.

impl<T: ?Sized, A: Alloc> Drop for Box<T, A>
[src]

[src]

Executes the destructor for this type. Read more