Skip to main content

new_uninit_boxed_slice

Function new_uninit_boxed_slice 

Source
pub fn new_uninit_boxed_slice<T>(
    len: usize,
) -> Result<Box<[MaybeUninit<T>]>, OutOfMemory>
Expand description

Allocate a new Box<[MaybeUninit<T>]> of the given length with uninitialized contents, returning Err(OutOfMemory) on allocation failure.

You can initialize the resulting boxed slice with boxed_slice_write_iter.