pub trait BoxExt: Sized {
type Output: ?Sized;
// Required method
fn emplace<Init: EmplaceInitializer<Output = Self::Output>>(
init: Init
) -> Self;
}Expand description
Abstract for type Box,Rc and etc to allocate value by EmplaceInitializer types.
Required Associated Types§
Required Methods§
sourcefn emplace<Init: EmplaceInitializer<Output = Self::Output>>(init: Init) -> Self
fn emplace<Init: EmplaceInitializer<Output = Self::Output>>(init: Init) -> Self
Allocate memory by std::alloc::alloc() and emplace value in it
Then use Self wrap it.