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]
impl<T, A: Alloc + Default> Box<T, A>
[src]
impl<T: ?Sized, A: Alloc> Box<T, A>
[src]
unsafe fn from_raw_in(a: A, ptr: *mut T) -> Self
[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(_)
.
unsafe fn into_raw(self) -> *mut T
[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]
unsafe fn from_raw(ptr: *mut T) -> Self
[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]
type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &T
[src]
Dereferences the value.