doc.rust-lang.org
pub fn downcast<T>(self) -> Result<Box<T, A>, Self>
Attempts to downcast the box to a concrete type.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn from_non_null(ptr: NonNull<T>) -> Self
Constructs a box from a NonNull pointer.
associated_function
alloc
Stable since 1.100.0
Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn from_raw(raw: *mut T) -> Self
Constructs a box from a raw pointer.
associated_function
alloc
Stable since 1.4.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_non_null(b: Self) -> NonNull<T>
Consumes the Box, returning a wrapped NonNull pointer.
associated_function
alloc
Stable since 1.100.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_pin(boxed: Self) -> Pin<Self>
Converts a Box<T> into a Pin<Box<T>>. If T does not implement Unpin, then *boxed will be pinned in memory and unable to be moved.
associated_function
alloc
Stable since 1.63.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_raw(b: Self) -> *mut T
Consumes the Box, returning a wrapped raw pointer.
associated_function
alloc
Stable since 1.4.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn leak<'a>(b: Self) -> &'a mut T
Consumes and leaks the Box, returning a mutable reference, &'a mut T.
associated_function
alloc
Stable since 1.26.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new(x: T) -> Self
Allocates memory on the heap and then places x into it.
associated_function
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new_uninit() -> Box<mem::MaybeUninit<T>>
Constructs a new box with uninitialized contents.
associated_function
alloc
Stable since 1.82.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new_uninit_slice(len: usize) -> Box<[mem::MaybeUninit<T>]>
Constructs a new boxed slice with uninitialized contents.
associated_function
alloc
Stable since 1.82.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new_zeroed() -> Box<mem::MaybeUninit<T>>
Constructs a new Box with uninitialized contents, with the memory being filled with 0 bytes.
associated_function
alloc
Stable since 1.92.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new_zeroed_slice(len: usize) -> Box<[mem::MaybeUninit<T>]>
Constructs a new boxed slice with uninitialized contents, with the memory being filled with 0 bytes.
associated_function
alloc
Stable since 1.92.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn pin(x: T) -> Pin<Box<T>>
Constructs a new Pin<Box<T>>. If T does not implement Unpin, then x will be pinned in memory and unable to be moved.
associated_function
alloc
Stable since 1.33.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn write(boxed: Self, value: T) -> Box<T, A>
Writes the value and converts to Box<T, A>.
associated_function
alloc
Stable since 1.87.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct BoxedArrayIntoIter<T, const N: usize, A>
A by-value Box<[T; N]> iterator.
struct
alloc
Stable since 1.100.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_mut_slice(&mut self) -> &mut [T]
Returns a mutable slice of all elements that have not been yielded yet.
method
alloc
Stable since 1.100.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_slice(&self) -> &[T]
Returns an immutable slice of all elements that have not been yielded yet.
method
alloc
Stable since 1.100.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod collections
Collection types.
module
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct TryReserveError
The error type for try_reserve methods.
struct
alloc
Stable since 1.57.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod binary_heap
A priority queue implemented with a binary heap.
module
alloc
Stable since 1.0.0
Version 1.100.0-nightly