Trait kernel::alloc::box_ext::BoxExt

source ·
pub trait BoxExt<T>: Sized {
    // Required methods
    fn new(x: T, flags: Flags) -> Result<Self, AllocError>;
    fn new_uninit(flags: Flags) -> Result<Box<MaybeUninit<T>>, AllocError>;
}
Expand description

Extensions to Box.

Required Methods§

source

fn new(x: T, flags: Flags) -> Result<Self, AllocError>

Allocates a new box.

The allocation may fail, in which case an error is returned.

source

fn new_uninit(flags: Flags) -> Result<Box<MaybeUninit<T>>, AllocError>

Allocates a new uninitialised box.

The allocation may fail, in which case an error is returned.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> BoxExt<T> for Box<T>

Implementors§