pub trait Emplace<T>: Sized { fn try_emplace<N: TryNew<Output = T>>(n: N) -> Result<Pin<Self>, N::Error>; fn emplace<N: New<Output = T>>(n: N) -> Pin<Self> { ... } }
A pointer type with a stable address that a New may be used to construct a value with.
New
This enables an emplace() method for Box, Rc, and Arc. Users are encouraged to implement this function for their own heap-allocated smart pointers.
emplace()
Box
Rc
Arc
Constructs a new smart pointer and tries to emplace n into its storage.
n
Constructs a new smart pointer and emplaces n into its storage.