Trait moveit::ctor::Emplace[][src]

pub trait Emplace<T>: Sized {
    fn try_emplace<C: TryCtor<Output = T>>(c: C) -> Result<Pin<Self>, C::Error>;

    fn emplace<C: Ctor<Output = T>>(c: C) -> Pin<Self> { ... }
}

A pointer type with a stable address that a Ctor 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

fn try_emplace<C: TryCtor<Output = T>>(c: C) -> Result<Pin<Self>, C::Error>[src]

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

Loading content...

Provided methods

fn emplace<C: Ctor<Output = T>>(c: C) -> Pin<Self>[src]

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

Loading content...

Implementations on Foreign Types

impl<T> Emplace<T> for Box<T>[src]

impl<T> Emplace<T> for Rc<T>[src]

impl<T> Emplace<T> for Arc<T>[src]

Loading content...

Implementors

Loading content...