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§
sourcefn new(x: T, flags: Flags) -> Result<Self, AllocError>
fn new(x: T, flags: Flags) -> Result<Self, AllocError>
Allocates a new box.
The allocation may fail, in which case an error is returned.
sourcefn new_uninit(flags: Flags) -> Result<Box<MaybeUninit<T>>, AllocError>
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.