Trait moveit::new::Emplace[][src]

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> { ... }
}
Expand description

A pointer type with a stable address that a New may be used to construct a value with.

This enables an emplace() method for Box, Rc, and Arc. Users are encouraged to implement this function for their own heap-allocated smart pointers.

Required methods

Constructs a new smart pointer and tries to emplace n into its storage.

Provided methods

Constructs a new smart pointer and emplaces n into its storage.

Implementations on Foreign Types

Implementors